Hi........
I have a Table name,Files,having column filename,filelength,
another side i have CSV file with file details like fileName filelength
ass 212
bss 444 so on.....
so How can i store(Update) csv content filename, filelength to Files table of filename and filelength respectiviy.
Please help me
thanks in advance............
Loading
EhteshamPosted May 16, 2012, 9:26 AM
1)Use StreamReader
2)read the contents line by line(string LineString=ReaderObj.readline())
3)Split the contents(FileName ,FileLength) using string[] Elements=LineString.split('\t');
Code snippet
StreamReader SrmReader = new StreamReader(Filename);
string Strline;
while ((Strline = SrmReader.ReadLine()) != null)
{
string[] Elements=Strline .split('\t')
// insert row to DB table or DataTable
}