Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

C sharp - Error while taking value from text file

$
0
0

Hi All,

I am working on Windows Forms application where values from text file is taken and inserted in database.

My text file contains almost 23 columns.

But for one column i am not getting complete value.

I am doing something like below.

strFolderPath  - .txt file path

strConn = @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source= " + strFolderPath + "\\; Extended properties='text; HDR=No; FMT=Delimited'";

strCommand = "SELECT * FROM " + strFileName;

OleDbDataAdapter oOledbDA = new OleDbDataAdapter(strCommand, strConn);

dsData = new DataSet();
 oOledbDA.Fill(dsData);

 foreach (DataRow dr in dsData.Tables[0].Rows)

{

strvenprod = dr[1].ToString();

}

dr[1] is having value called BF9370 but strVendorprod shows only 9370.

Please someone give some idea.

Thanks in advance.


blrSvsTech


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>