J
jrbrady
I just converted an Access 2002 application into VB.NET
(don't ask). VBA in Access has a nifty command for
importing XML into an Access table called, unsurprisingly
ImportXML(). It works like this: Application.ImportXML
([XML Filename]). The table name is a field in the .xml
file.
So, my question is, how do I do this in VB.NET using
ADO.NET into SQL Server? There's a DataSet command called
ReadXml that (supposedly) loads a DataSet with data from
a .xml file. But how do I save that data in my SQL Server
database?
I've tried this:
Dim da As DataAdapter = New DataAdapter("SELECT * FROM
[tblName]", sqlDBConn)
Dim ds As New DataSet
ds.ReadXml([XML Filename])
da.Update(ds)
....to no avail. And I've tried:
Dim da As DataAdapter = New DataAdapter("SELECT * FROM
[tblName]", sqlDBConn)
Dim ds As New DataSet
Dim dt As DataTable = ds.Tables.Add"([tblName]")
ds.ReadXml([XML Filename])
da.Update(ds)
....also to no avail. Please help. Thank you.
(don't ask). VBA in Access has a nifty command for
importing XML into an Access table called, unsurprisingly
ImportXML(). It works like this: Application.ImportXML
([XML Filename]). The table name is a field in the .xml
file.
So, my question is, how do I do this in VB.NET using
ADO.NET into SQL Server? There's a DataSet command called
ReadXml that (supposedly) loads a DataSet with data from
a .xml file. But how do I save that data in my SQL Server
database?
I've tried this:
Dim da As DataAdapter = New DataAdapter("SELECT * FROM
[tblName]", sqlDBConn)
Dim ds As New DataSet
ds.ReadXml([XML Filename])
da.Update(ds)
....to no avail. And I've tried:
Dim da As DataAdapter = New DataAdapter("SELECT * FROM
[tblName]", sqlDBConn)
Dim ds As New DataSet
Dim dt As DataTable = ds.Tables.Add"([tblName]")
ds.ReadXml([XML Filename])
da.Update(ds)
....also to no avail. Please help. Thank you.