Re: WebService DataSet
From: Val Mazur (group51a_at_hotmail.com)
Date: 09/30/04
- Next message: JeffCT: "Help in Design"
- Previous message: Val Mazur: "Re: How to Query Offline in ADO.NET"
- In reply to: Strider: "WebService DataSet"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Sep 2004 00:02:19 -0400
Hi,
If you just retrieved data into dataset, then all the datarows in this
dataset will have status unchanged, which means when you call Update method
of the dataadapter, it will do nothing. Dataadapter will insert only
records, where status is Added. You could achieve it using several ways. One
is to load DataSet into XML parser and change status of the datarows there.
Another way is to loop and insert records one-by-one using INSERT SQL
statement
--
Val Mazur
Microsoft MVP
"Strider" <Strider@discussions.microsoft.com> wrote in message
news:FFB16A87-80D9-45BB-8D97-0096C1765F88@microsoft.com...
> In my WebService i return a DataSet. However when i try an add a table
> from
> this dataset into the database it does not work. It is very frustrating.
> Here
> is what im trying to do. I create a seperate dataset so i can update each
> table in the database serperately.
>
> Dim webserv As New pmlDBService
> Dim myds As New DataSet
> Dim mydt As New DataTable
> myds = webserv.GetFullTables()
> mydt = myds.Tables("Routes").Copy
> ds1.Tables.Add(mydt)
>
> Dim da2 As New SqlDataAdapter("SELECT * FROM Routes", conn2)
> Dim x As SqlCommandBuilder = New SqlCommandBuilder(da2)
>
> da2.Update(ds1, "Routes")
- Next message: JeffCT: "Help in Design"
- Previous message: Val Mazur: "Re: How to Query Offline in ADO.NET"
- In reply to: Strider: "WebService DataSet"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|