Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML To Dataset
Message
De
18/03/2008 17:26:28
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
01303148
Message ID:
01303187
Vues:
20
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/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform