title: vb.net imports wrong data from excel into datagridview
body: <p>i encountered a problem during importing data from excel to datagridview in VB.net.
  And i dont know or where to start to search for the problem. Here's the situation:
  I have an excel file,</p>
  
  <pre><code>Column A(General)     Column B(Time)
  
   Adarayan, Dianne       6:00 AM
   Bacalla, Cruz          1:30 PM
   Mariano, Kevin           RD
   Roses, Alice             VL
   Ligris, Paul           RD/OT 7:30 
  </code></pre>
  
  <p>Output/ Display in datagridview:</p>
  
  <pre><code> Team Member            TimeSchedule
  
   Adarayan, Dianne         0.25
   Bacalla, Cruz            0.5625
   Mariano, Kevin           RD
   Roses, Alice             VL
   Ligris, Paul           RD/OT 7:30 
  </code></pre>
  
  <p>I dont know why this happens, when the string is like the first 2 rows it displays float.
  Please help guys.</p>
  
  <p>This is my code in importing data from excel to datagridview.</p>
  
  <pre><code>  OpenFileDialog1.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.Desktop
      OpenFileDialog1.Filter = "Excel Files 2007 (*.xlsx)|*.xlsx|Excel Files 1997-2003 (*.xls)|*.xls"
  
      If OpenFileDialog1.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK Then
  
          Try
  
              xlsApp = New Excel.Application
              xlsWorkBook = xlsApp.Workbooks.Open(OpenFileDialog1.FileName)
              xlsWorkSheet = xlsWorkBook.Worksheets("WORK SCHEDULE")
              'unprotect file 
              'Get last row used 
              'lastUsedRow = xlsWorkSheet.Range("I" &amp; xlsWorkSheet.Rows.Count).End(Excel.XlDirection.xlUp).Row
              'Get last column 
              'lastUsedCol = xlsWorkSheet.Cells(1, xlsWorkSheet.Columns.Count).End(Excel.XlDirection.xlToLeft).Column
  
              Dim fi As New FileInfo(OpenFileDialog1.FileName)
              Dim sConnectionStringz As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &amp; OpenFileDialog1.FileName &amp; ";" &amp; "Extended Properties=""Excel 8.0;HDR=NO;IMEX=1"""
              Dim objConn As New OleDbConnection(sConnectionStringz)
              objConn.Open()
              Dim x As Integer = 0
              Dim start As Integer
              Dim ends As Integer
  
  
              For Each c In xlsWorkSheet.Range("B1:B300").Cells
                  If IsNothing(c.value) Then
                      x = x + 1
                  ElseIf Not IsNothing(c.Value) Then
                      x = x + 1
                      If c.value.ToString.ToUpper &lt;&gt; "START" And c.value.ToString.ToUpper &lt;&gt; "END" Then
                      ElseIf c.value.ToString.ToUpper = "START" Then
                          start = x
                      ElseIf c.value.ToString.ToUpper = "END" Then
                          ends = x
                      End If
                  End If
              Next
  
              Dim campaign = start + 1
              For Each c In xlsWorkSheet.Range("B" &amp; campaign &amp; ":B" &amp; campaign).Cells
                  If Not IsNothing(c.value) Then
                      campaignName = c.value.ToString
                  End If
              Next
  
              Dim objAdapter1 As New OleDbDataAdapter("SELECT * FROM [WORK SCHEDULE$B" &amp; start &amp; ":I" &amp; ends &amp; "]", objConn)
              Dim objDataset1 As New DataSet
              objAdapter1.Fill(objDataset1)
              DataGridView1.DataSource = objDataset1.Tables(0).DefaultView
              With DataGridView1
                  .RowHeadersVisible = False
                  .Columns(0).HeaderCell.Value = "Team Members"
                  .Columns(1).HeaderCell.Value = "Monday"
                  .Columns(2).HeaderCell.Value = "Tuesday"
                  .Columns(3).HeaderCell.Value = "Wednesday"
                  .Columns(4).HeaderCell.Value = "Thursday"
                  .Columns(5).HeaderCell.Value = "Friday"
                  .Columns(6).HeaderCell.Value = "Saturday"
                  .Columns(7).HeaderCell.Value = "Sunday"
              End With
              objConn.Close()
          Finally
  
      End Try
      End If
  </code></pre>