open text file write to file close file

outcast1881

Active member
Joined
Aug 25, 2006
Messages
38
Programming Experience
Beginner
Hi everyone,
I am using vb express and sql express.I can transfer a complete data table to a text file using sql and OLE connections.

but the thing I am trying to do is,after I insert a new row to my data table,
I want to open a text file,write the values in my new row to that file and save it and let's say the file called test1.txt(it will be csv of course),the logic is something like that:

open sql connection
insert into table a(col,col2) values (@a1,@a2)
open test1.txt
write (the row containing new col1,col2 values)
close test1.txt

do I have to use textwriter or streamwriter or smthg else?

Thank you in advance!

Can
 
Hmmm,
This means I still didn't get it...The command inserts the values but some values are missing in the data table....

cmd1 = New SqlCommand("insert into taginfo(material_number,description) values (" & lineValues(1) & ",'" & lineValues(2).Replace(" ' ", " '' ") & "')", sqlconnection1)

do you have an idea what can be the reason for that?

Thanks,

Can
 
Hi,
sorry,I just realised that it inserts but not in order...like 10010 first ,10011 second....But why,before using replace they were in asc order...
regards,
Can
 
Back
Top