MetaChat REGISTER   ||   LOGIN   ||   IMAGES ARE OFF   ||   RECENT COMMENTS




artphoto by splunge
artphoto by TheophileEscargot
artphoto by Kronos_to_Earth
artphoto by ethylene

Home

About

Search

Archives

Mecha Wiki

Metachat Eye

Emcee

IRC Channels

IRC FAQ


 RSS


Comment Feed:

RSS

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...**
posted by seanyboy 06 July | 09:52
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.
posted by seanyboy 06 July | 09:55
Aha: The secret lies with the SqlCommandBuilder.
Suck it H8rs'
posted by seanyboy 06 July | 10:31
So, is it possible to write a novel in eight weeks? Day One of my endeavor begins... || This is a whipping thread.

HOME  ||   REGISTER  ||   LOGIN