473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 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 1927
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: PAUL EDWARDS | last post by:
I have a windows form that is bound to a datatable. In VB6 I could just update the field contents and it would be updated in the database, however if I update the text property of the control from...
2
by: Niyazi | last post by:
Hi, I have not understand the problem. Before all the coding with few application everything worked perfectly. Now I am developing Cheque Writing application and when the cheque is clear the...
6
by: Babu Mannaravalappil | last post by:
Can somebody please help me figure out why the following method exceptions out? Execution at the line marked with ********** hangs for about 15 seconds and then I get an error that says an...
2
by: Mojtaba Faridzad | last post by:
Hi, Please check these lines: DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet, "mytable"); DataRow row; row = dataSet.Tables.Rows; row.BeginEdit(); row = "555";
1
by: Bennett Haselton | last post by:
Suppose I add a new row to a table in a dataset, and then I use an OleDbDataAdapter to add that new row to a SQL Server database using OleDbDataAdapter.Update(), as in the following code: ...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
2
by: Richard | last post by:
Hi, I have 1 dataset with 2 tables (Table1 as parent, Table2 as Child), 1 row in both the tables. I am updating it with a transaction. First parent then child. When child update fails, it raise...
7
by: Jean Christophe Avard | last post by:
Hi! I have a dataset that retreive all the item information from the database. I need to be able to edit them, in the dataset and in the database. I have this code, could anyone tell me if I'm...
5
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.