Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding XML to a Table
Message
From
25/07/2003 14:03:14
 
 
To
25/07/2003 13:22:13
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
00813556
Message ID:
00813580
Views:
14
Jim,

I guess I don't get what you're trying to do ... your code isn't doing anything with XML from what I can see, unless I missed something (not being a VB kind of person).

~~Bonnie


>All,
>
> I have created a program that works with both XML and SQL Server. One of the things I want to be able to do is add XML data to a table that the user selects. I have tried for hours and hours to get this to work with the Command builder object, but have failed. The code I have is below. My questions are What is wrong with the code? Second, Is there a better way to import XML data into a dataset?
>
>Any thoughts would be appreciated!
>
>Here's the code:
> Dim cmdBuilder As SqlClient.SqlCommandBuilder
> Dim oTableImport As New TableImport(Me.oParentForm.activeTableName)
> oTableImport.ShowDialog()
> Me.oParentForm.activeConnection.Open()
> oParentForm.daBrowse.SelectCommand.CommandType = CommandType.Text
> oParentForm.daBrowse.SelectCommand.CommandText = "Select * from " + oTableImport.Table
> oParentForm.daBrowse.SelectCommand.Connection = oParentForm.activeConnection
> cmdBuilder = New SqlClient.SqlCommandBuilder(oParentForm.daBrowse)
> oParentForm.daBrowse.Fill(dsGridData, oTableImport.Table)
> cmdBuilder.GetDeleteCommand()
> cmdBuilder.GetUpdateCommand()
> cmdBuilder.GetInsertCommand()
> oParentForm.daBrowse.Update(dsGridData, oParentForm.activeTableName)
> dsGridData.AcceptChanges()
> Me.oParentForm.activeConnection.Close()
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform