Groups | Blog | Home
all groups > vb.net data > june 2004 >

vb.net data : Creating table from dataset


Jay B. Harlow [MVP - Outlook]
6/25/2004 6:04:28 PM
John,
Create a DataAdapter with the commands to update the access table. Call
Update on the DataAdapter passing the dataset you received.

Hope this helps
Jay

[quoted text, click to view]

John
6/25/2004 11:59:48 PM
Hi

I have a dataset which has received its data from a remote web service. How
can I now save the dataset into a local access table?

Thanks

Regards

John
6/26/2004 12:25:30 AM
Hi Jay

Here is how far I have gone;

Dim ws As localhost.StaffDiary
Dim ds As DataSet = ws.GetStaffDiary
Dim da As OleDbDataAdapter
da.UpdateCommand.CommandText("SELECT srctble.* INTO [desttble]")
da.Update(ds)

I can't figure out a) what would be the name of the srctable if the data is
coming from a remote web method and b) what is the syntax of update command
if I want the data to go into a new table desttble in a local access db.

Thanks

Regards


[quoted text, click to view]

Jay B. Harlow [MVP - Outlook]
6/28/2004 9:00:09 AM
John,
The UpdateCommand needs to have a valid UPDATE statement in it.

The srctable is going to be the name of the DataTable in the DataSet.

If you don't already have it, you may want to pick up Sceppa's book as he
discusses how to Fill a DataTable from one database and Update a second
database from a second. The one caveat is I would expect the Web Service to
return the rows with AcceptChanges done, you want AcceptChanges not to be
done.

For details on this and other exciting questions on ADO.NET (Datasets) I
would recommend Sceppa's book, which is a good tutorial on ADO.NET as well
as a good desk reference once you know ADO.NET. David Sceppa's book is
"Microsoft ADO.NET - Core Reference" from MS press.

Hope this helps
Jay



[quoted text, click to view]

John
6/28/2004 8:22:10 PM
Got it. I think I should now start reading it. :) Certainly sounds worth
while.

Regards

[quoted text, click to view]

AddThis Social Bookmark Button