469,097 Members | 1,556 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,097 developers. It's quick & easy.

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 1805
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
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.