Oct 7, 2010
I am writing out a CSV file in a VB.NET Windows Application. It is a string, like this:99,Company,00666,TBDOn another form, the user can browse to this file and open it.When he does, I use the Microsoft Jet OleDB provider and read this file into a datagridview. It displays the four columns in the grid, but it truncates the two leading zeroes on 00666 and displays 666.I need those leading zeroes. I tried writing out the string like this:99,Company,'00666,TBD(notice the leading single quote before 00666, like you would type in an Excel cell to indicate it was text), but then when the four columns are displayed in the grid, I have the single quote and the two leading zeroes. I don't want the single quote, I just thought I could use it to indicate text.So my question is how can I write out a string of leading zeroes and have them read into the grid preserved?
View 10 Replies