Johncliviger at aol.com
Johncliviger at aol.com
Tue Apr 22 04:40:48 CDT 2008
Hi All As part of my teach yourself vb.net 2005/08 project I'm trying to import a .txt file(with white space between columns) into an Array, clean it up and dump it into a SQL express table all nicely cut up with the appropiate datatypes. So far I've got my vb project to read the file contents into an ArrayList and using Console.Writeline() I get a pretty display of data in columns in the output window. I'm now geting an attack of self doubt that my approach is correct. Heres my thinking. 1) Build a Class to read a xxxxx.txt file into an Array (1D array) using MS.VB.FileIO.TextFieldParser(file path and name). 2) Then loop thru the Array cutting up the string using String.Split and assigning a datatype as we go thru the loop. 3) Dump each new field into a Dataset. Run and Append query to populate the SQL table. I'd be grateful for any comments as to my modus operandi. Regards johnc