Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML To Dataset
Message
From
18/03/2008 17:26:28
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01303148
Message ID:
01303187
Views:
19
Freehanded and not tested, and in VB:
Dim myConn As New SQLConnection(myConnectionString)
Dim myCmd AS SQLCommand = Nothing
Dim mySql As String = "INSERT INTO myTable(field1, field2) VALUES ('{0}','{1}')"

myConn.Open

For Each row As DataRow in myDataSet.Rows
    myCmd = New SQLCommand(String.Format(mySQL, _
                                         row("value1").ToString, _
                                         row("value2").ToString))
    myCmd.Connection = myConn
    myCmd.ExecuteNonQuery    
Next

myConn.Close
>Ok, so I have this working. From some Google searchs I get the impression that I need a DataAdapater to
>get this data back into the DB.
>
>Can you point me in the right direction?
>
>
>public void UpdateUser(string sUserXML)
>{
>
>    StringReader oReader = new System.IO.StringReader(sUserXML);
>    DataSet oDataSet = new DataSet();
>    oDataSet.ReadXml(oReader);
>
>}
>
>
>Thanks
Very fitting: http://xkcd.com/386/
Previous
Reply
Map
View

Click here to load this message in the networking platform