472,142 Members | 1,288 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

update DataSet

hi i get dataset from'an webservice so i don't have an adaptor... dataset's
structure is same as mine database table....

how can i update database table according to dataset...
Nov 16 '05 #1
5 1862
Sadun Sevingen wrote:
hi i get dataset from'an webservice so i don't have an adaptor... dataset's
structure is same as mine database table....

how can i update database table according to dataset...


What exactly do you mean by database table.
There is a table withing the DataSet.
If you do not have an adapter I assume the DataSet has already been
filled. This is all you need the adapter for as far as I know.
(adapter.Fill(ds))

Assuming DataSet was filled by the webservice:

DataSet ds;
..
..
//ds filled by adapter and you get the resulting DataSet
..
..
foreach(DataRow row in ds.Tables[0].Rows)
{
//do whatever you gotta do
//for example access string data from each row
//row.ItemArray[0].ToString()
//colum one in this case
//row.ItemArray[1].ToString()
//is colum 2 and so forth
//if you know the DataSet structure it shouldnt be a problem
}

Hope it helps.
Nov 16 '05 #2
Hope it helps:
http://www.devcity.net/net/article.aspx?alias=20020331
--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
"Sadun Sevingen" <b-******@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
hi i get dataset from'an webservice so i don't have an adaptor... dataset's structure is same as mine database table....

how can i update database table according to dataset...

Nov 16 '05 #3
remote computers webservice takes an table content from its DB with an
adaptor and fill it into dataset... then it returns the dataset ...

my application takes the dataset that send from webservice. at that point i
want to issue the datasets' content into my localcomputer by the
application...

what should i do... i don't prefer issue row by row.. i try to use
AffectedRowNum = myAdapter.Update(DSet, DataSetName);

as you see if you want to use your dataset you should have an adapter thats
related with it ??
Nov 16 '05 #4
Sadun Sevingen wrote:
remote computers webservice takes an table content from its DB with an
adaptor and fill it into dataset... then it returns the dataset ...

my application takes the dataset that send from webservice. at that point i
want to issue the datasets' content into my localcomputer by the
application...

what should i do... i don't prefer issue row by row.. i try to use
AffectedRowNum = myAdapter.Update(DSet, DataSetName);

as you see if you want to use your dataset you should have an adapter thats
related with it ??


There is a good chance that I am completely wrong, but you can try this.

//assuming you have the dataset from server;
DataSet dsFromServer = new...;

//at this point create the adapter to your *local* data
//it shouldnt be much different from the way you did it at the web service
//something like this
OleDbDataAdapter localAdapter = new OleDbDataAdapter(...);

//now since you have
//-the adapter linked to local data
//-the dataset you recieved through web service
//you can use one of the overloads of OleDbDataAdapter.Update() method.
//one simple possibility
int numAffected = adapter.Update(dsFromServer);

Good Luck
Nick Z.
Nov 16 '05 #5
thank you it didn't help out but i'm still searching on it...
Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by PAUL EDWARDS | last post: by
2 posts views Thread by Mojtaba Faridzad | last post: by
2 posts views Thread by Richard | last post: by
7 posts views Thread by Jean Christophe Avard | last post: by
5 posts views Thread by PAUL | last post: by
8 posts views Thread by Zorpiedoman | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.