Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Update underlying data using a DataSet and Webservices

Reply
Thread Tools

Update underlying data using a DataSet and Webservices

 
 
Alex
Guest
Posts: n/a
 
      03-08-2006
Hello,
I am using a webservice to interact with my back end database. I have
successfully, created a few methods which pull data in a specific format. I
am having trouble using the update command in a DataAdapter and a newly
modified DataSet to update the database. I have seen a few articles which
demonstrate this, but when I try them the give me the errors, below is what I
have tried to do, and the error I get.


This exactly as it appeared in the article.

[WebMethod]
public DataSet GetCustomers()
{
SqlConnection con = new SqlConnection("server=servername;uid=login;
pwd=password;database=northwind");
SqlDataAdapter daCust = new SqlDataAdapter("Select * From
Customers", con);
DataSet ds = new DataSet();
daCust.Fill(ds, "Cust");
return ds;
}

[WebMethod]
public DataSet UpdateCustomers(DataSet ds)
{
SqlConnection con = new
SqlConnection("server=servername;uid=login;
pwd=password;database=northwind");
SqlDataAdapter daCust = new SqlDataAdapter("Select * From
Customers", con);
SqlCommandBuilder cbCust = new SqlCommandBuilder(daCust);
daCust.Update(ds, "Cust");
return ds;
}


The error I get is as follows;

System.InvalidOperationException: Update unable to find
TableMapping['tbl_DCustomers'] or DataTable 'tbl_DCustomers'.
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)

Does any one have any suggestions?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wsdl errors for multiple webservices with reference to same dataset wc_chan ASP .Net 1 12-07-2006 05:50 AM
ASP.NET 2.0 C# DataSet -> WebServices David R. ASP .Net 2 01-11-2006 07:10 AM
using dataset writexml to update data and losing formatting Randall Arnold ASP .Net 0 12-22-2005 05:20 PM
WebServices Return DataSet + String as Object SMG ASP .Net 4 04-26-2005 02:36 AM
Webservices XML, XSLT and the Dataset Joseph ASP .Net Web Services 0 02-17-2004 03:34 PM



Advertisments