"tshad" <t@home.comwrote in message
news:ew**************@TK2MSFTNGP06.phx.gbl...
How do I tell DataAdapter that Column 2 and 3 are string and not integer?
Following is the example data that comes from the .csv file
FEDERAL TAX,1084,0000
COREHCR,1084,0000
CLIENT P,1084,0000
The select is:
OleDbDataAdapter da2 As New OleDb.OleDbDataAdapter("Select * from " &
"CorelandGLConversion.csv", conn);
The problem is that it thinks the 3rd column is an integer and changes the
0000 to 0.
Can I tell it in the Select statement that the column is a varChar? I
can't do it after reading in the data as the data will already have
changed the 0000 to 0 at that point.
I tried to set up the table as:
DataTable DTGLConversion as DataTable;
DTGLConversion.Columns.Add("F1", System.Type.GetType("System.String"));
DTGLConversion.Columns.Add("F2", System.Type.GetType("System.String"));
DTGLConversion.Columns.Add("F3", System.Type.GetType("System.String"));
da2.Fill(DTGLConversion);
DataSetObj.Tables.Add(DTGLConversion);
This sets up the columns as strings in the DTGLConversion Table and adds it
to the Dataset but it seems the Select in the DataAdapter must have already
converted the string "0000" to integer 0 and then when I filled the
DataTable it reconverted it to "0".
How do I fix this?
Thanks,
Tom
>