title: Fill datatable columns from excel as a string
body: <p>I am filling a data table from an excel sheet which is formatted (decimals, dates, etc...).</p>
  
  <p>My problem is that the columns are being formatted as the excel sheet, but I need to fill all the columns as string, how can I do that?</p>
  
  <p>My import method:</p>
  
  <pre><code>Private Function upload(filename As String) As DataTable
          Dim FilePath__1 As String = "Uploads/"
          Try
              Dim allowdFile As String() = {".xls", ".xlsx"}
              Dim FileExt As String = ".xls"
  
              Dim isValidFile As Boolean = allowdFile.Contains(FileExt)
              If Not isValidFile Then
                  Return Nothing
              Else
                  Dim filePath__2 As String = Server.MapPath(FilePath__1) &amp; filename
  
                  Dim con As OleDbConnection = Nothing
                  If FileExt = ".xls" Then
                      con = New OleDbConnection((Convert.ToString("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=") &amp; filePath__2) + ";Extended Properties=Excel 8.0;")
                  ElseIf FileExt = ".xlsx" Then
                      con = New OleDbConnection((Convert.ToString("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=") &amp; filePath__2) + ";Extended Properties=Excel 12.0;")
                  End If
                  con.Open()
  
                  Dim dt As DataTable = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
  
                  Dim getExcelSheetName As String = dt.Rows(0)("Table_Name").ToString()
  
                  Dim ExcelCommand As New OleDbCommand((Convert.ToString("SELECT * FROM [") &amp; getExcelSheetName) + "]", con)
                  Dim ExcelAdapter As New OleDbDataAdapter(ExcelCommand)
                  Dim ExcelDataSet As New DataSet()
                  ExcelAdapter.Fill(ExcelDataSet)
                  con.Close()
                  If ExcelDataSet.Tables.Count &gt; 0 Then
                      Return ExcelDataSet.Tables(0)
                  Else
                      Return Nothing
                  End If
              End If
          Catch ex As Exception
              Return Nothing
          End Try
      End Function
  </code></pre>
  
  <p>Any help would be nice.</p>