Hi
I posted this in the ASP forums but think its more of a vb question so sorry for the repost:
I have an app that will load info from a csv into a gridview. Everything works properly except for one column. It is only displaying fields with numeric values. All of the alpha-numeric cells are being left blank. I have looked at the csv and it is properly formatted and the other columns have alpha-numeric as well and are being pulled in properly.
Here is a snippet of the code that populates the gridview. Any help would be most appreciated.
The Item column is the one that is coming in incorrectly.Code:Dim savePath As String = "\\Depts\" Dim Conn As System.Data.Odbc.OdbcConnection Dim dt As New System.Data.DataTable Dim da As System.Data.Odbc.OdbcDataAdapter Dim strConnstr, strImportfolder, strFilename As String strFilename = FileUpload1.FileName 'this is the csv file to be imported strConnstr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + savePath + ";" Conn = New System.Data.Odbc.OdbcConnection(strConnstr) da = New System.Data.Odbc.OdbcDataAdapter("SELECT Site, Line , Item, Date FROM [" + strFilename + "]", Conn) da.Fill(dt) Session("Import") = dt GridView1.DataSource = Session("Import") GridView1.DataBind()




Reply With Quote