MetaChat is an informal place for MeFites to touch base and post, discuss and
chatter about topics that may not belong on MetaFilter. Questions? Check the FAQ. Please note: This is important.
06 July 2006
Technical AskMecha: Sorry, sorry, but I'm in a bind (ha); Anyone know how to use vb.net (2005) datasets? I can't insert data easily.→[More:]
Dim sConnectString As String = "Data Source=XPBRIAN;Initial Catalog=Phocus;Integrated Security=True"
Dim daPostFile As SqlDataAdapter = New SqlDataAdapter("SELECT * from slpost;", sConnectString)
Dim dsPostFile As DataSet = New DataSet("postfile")
daPostFile.Fill(dsPostFile)
Dim rowPost As DataRow = dsPostFile.Tables(0).Rows.Add
rowPost.BeginEdit()
rowPost.Item("InvoiceNumber") = "Testing"
rowPost.AcceptChanges()
This is how I assumed you added data into a table. What am I doing wrong? Why do I need to build a big log "INsert" command when the DataSet knows what the table looks like?
**This is what happens when you assume you can learn a new programming language in less than a day... I mean, how hard could it be...**
Also, Any good resources that'll take me through this with reasonable examples? I'm not trying to write a bomb-proof piece of software, I'm just trying to import data from a CSV File.