to read from a notepad file line by line and insert each line into one table
-
i have a txt file with 1000 names and a table with two fields, id and NAME. i want to read the contents from the txt file line by line and insert each line to the name field of the table.. how can i implements this using c#.. George Mathew
-
i have a txt file with 1000 names and a table with two fields, id and NAME. i want to read the contents from the txt file line by line and insert each line to the name field of the table.. how can i implements this using c#.. George Mathew
-
i have a txt file with 1000 names and a table with two fields, id and NAME. i want to read the contents from the txt file line by line and insert each line to the name field of the table.. how can i implements this using c#.. George Mathew
Hi, I am already using this command. Using System.IO; FileStream fileStreamMainINI = new FileStream("MYWORK.TXT", FileMode.OpenOrCreate, FileAccess.Read); StreamReader srMainINI = new StreamReader(fileStreamMainINI); string strLineValue = null; while (srMainINI.Peek() > -1) { strLineValue = srMainINI.ReadLine(); // and then you may use this string value anywhere }
-
Use this example from MSDN and do your DB inserts instead of Console.WriteLine http://msdn2.microsoft.com/en-us/library/aa287535(VS.71).aspx[^]
DaveyM69 wrote:
and do your DB inserts instead of Console.WriteLine
:-D -Larantz-
for those about to code, we salute you
http://www.itverket.noPlease refer to the Forum Guidelines for appropriate posting.