Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / June 2004

Tip: Looking for answers? Try searching our database.

Getting web service data in a local table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 26 Jun 2004 00:28 GMT
Hi

I am getting a dataset from a remote web method. I need to get the data in
the dataset into a local access table. Here is how far I have gone;

Dim ws As localhost.MyService
Dim ds As DataSet = ws.MyMethod
Dim da As OleDbDataAdapter

da.UpdateCommand.CommandText("SELECT srctble.* INTO [desttble]")
da.Update(ds)

What I can't figure out is 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
Dino Chiesa [Microsoft] - 30 Jun 2004 05:13 GMT
You can map from the source table to the destination table with a
DataTableMapping. (and optionally a set of DataColumnMapping 's).

The source table is the table the data has come FROM, which I presume exists
in a database that is accessible only on the server side. This table name is
contained in the dataset.

The destination table is where you want the data to go, which is MS Access.

This example shows how to copy data from one database to another using a
single dataset, and a DataTableMapping.
http://www.winisp.net/cheeso/srcview.aspx?dir=misc&file=copydata.cs

The difference for you is,
 - you obtain the dataset from a webservice, not directly from a database.
 - you are copying into a MS Access db, not a SQL Server db.  This means
you will need to use a OleDbDataAdapter, not a SqlDataAdapter (but you
already knew that)

you can also check the reference page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemdatacommondataadapterclasstablemappingstopic.asp


Couple other comments:
 - I am pretty sure your UpdateCommand should not be a SELECT.  It should
probably be an INSERT or UPDATE.
 - You will need to actually update each row in the dataset if you want the
UpdateCommand to be applied.  See the example given above.

-D

> Hi
>
[quoted text clipped - 16 lines]
>
> Regards

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.