VBAHole22 Posted November 19, 2003 Posted November 19, 2003 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? Quote Wanna-Be C# Superstar
Administrators PlausiblyDamp Posted November 19, 2003 Administrators Posted November 19, 2003 DataSets have a ReadXML method you could use to get the data into the dataset, you should then be able to use a DataAdapter to update the database. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
VBAHole22 Posted November 19, 2003 Author Posted November 19, 2003 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? Quote Wanna-Be C# Superstar
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.