Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a web service set up in VB.NET that accepts a string stream of XML data from a remote client. I would like to take this xml data and send it to a database.

My question is how do I go about doing this?

Do I load a dataadapter and datatable and loop through each record and send an update statment to the Access db?

Or is there a way to send all of the records wholesale into the access table?

I know that my client and server databases are identical in structure and that there will be no primary key violations in an INSERT INTO statement.

 

Any suggestion?

Wanna-Be C# Superstar
Posted

I have read the XML data into a dataset like so:

 

Dim dstAsset As New DataSet

dstAsset.ReadXml(XMLStream)

 

and then I created a datatable like so:

 

Dim dtbAssets As DataTable

dtbAssets = dstAsset.Tables("Assets")

 

And I have a connection string and a connection:

 

Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = C:\Mothership.mdb"

Dim objConn As New OleDbConnection(strConn)

Try

objConn.Open()

 

BUt the data adapter requires a select command as one of its parameters:

 

Dim dadMembers As New OleDbDataAdapter(????? , objConn)

 

I don't really have or need a select command here as all I want to do is send all of the data to the db.

 

What would I do in this case?

Wanna-Be C# Superstar

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...