473,756 Members | 7,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1948
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(d s))

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-******@microsof t.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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.Updat e(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.Updat e(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
OleDbDataAdapte r localAdapter = new OleDbDataAdapte r(...);

//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 OleDbDataAdapte r.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
2438
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 code it is 50% chance that the update will make it back to the dataset. If I update the dataset instead of the form, it does not show on the form. Is there a method that should be used?
2
5266
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 user have to open a form and entera date so we know in report that the desiered check has been cleared. It takes me while to wrtie. But when I try to update the datagrid changes via dataset to MS Access 2003 I get an error that simply says...
6
2502
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 Unhandled StackOverFlowException occurred. The execution does not even get passed to the catch block. At the time of my test, only one of 12 tables in the dataset (catalogsDS) really has changes. The dataset is not a huge one. Most tables have less...
2
12668
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
5090
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: dsLocalDataSet.user_postRow newRow = dsLocalDataSet1.user_post.Newuser_postRow(); newRow.post_text = this.lblHiddenMessageStorage.Text; newRow.post_datetime = System.DateTime.Now; dsLocalDataSet1.user_post.Adduser_postRow(newRow);...
9
12988
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 northwind database that has an employees, orders, and order details. the following are the 3 tables in my sql database students schyrsem
2
2023
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 an exception, and rollback the parent update. But it also change the rowstate of the parent row from Added to unchanged When you try to save again parent row never get created in database. So child update will fail again. Please suggest what am I...
7
3364
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 in the good way, cause I build that code from a book example, but nothing works. I HAVE THIS CODE TO SAVE THE CHANGE OF THE DATASET dstPlant.Tables("plant").Rows(intEditRow)("latin_name") = "KLHJJKJKJKHHHHHH"
5
3542
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 do the update the changed parentid in the child table fails to change. No error is given its just that the change is not written to the Database. When I step through the records for the child table the one I would expect to be changed has a row...
8
2696
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. Example: I have a dataadapter that contains one table with one row. I change the value of the 'FisrtName' column in that row from Jack to John. I call ..update on the dataadapter it goes through fine. Now I change that same column in that same row...
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10040
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9873
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.