Hi All,
I am creating a utility in which reading data from text file and iinserting in access table
Following is the actual data in text file
Col1,Col2,Col3,Col4,Col5,
10317288,,A,00000000,00000000,
10601329,,A,20120424,20121031,
02573A7B3F1,,A,20060518,99991231,
0434C129E41,,A,20060331,99991231,
But after imported in ms acess getiing only col1 numeric values
Col1 Col2 Col3 Col4 Col5
10317288 A 0 0
10601329 A 20120424 20121031
A 20060518 99991231
A 20060331 99991231
Connection String is as follow
String ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + dbPath;
And insert query is as follow.
DataTable dtTblQry = openAccessDB("delete from " + strTblName);
strSql = "insert into " + strTblName + " select " + strFields + " from ";
strSql += "[Text;IMEX=1;HDR=YES;DATABASE=" + System.Windows.Forms.Application.StartupPath + "\\DATA\\" + ";]";
strSql += ".";
strSql += "[" + strTblName + ".txt]";
dtTblQry = openAccessDB(strSql);
Please help me to resolve this issue!!
Thanks in Advance