473,387 Members | 1,481 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,387 software developers and data experts.

Error when updating database from datatable

Hi All,

I got this error when updating database from datatable.

{"Update unable to find TableMapping['Table'] or DataTable 'Table'."}

Here is my code (modified) :

Expand|Select|Wrap|Line Numbers
  1. SqlCeDataAdapter da = new SqlCeDataAdapter("SELECT * FROM  Name", con);
  2. DataSet ds = new DataSet();
  3. da.Fill(ds, "Name");
  4. foreach (DataRow dr in ds.Tables["Name"].Rows)
  5.  {
  6. Console.WriteLine(dr["FirsName"] + "\t" + dr["NickName"] + "\t" + dr["Address"] + "\t" + dr["Gender"]);
  7.     dr["Gender"]="Male";
  8. }
  9. da.Update(ds);
  10. Console.Write("Press Enter to continue:");
  11. Console.ReadLine();
Any Help??

Thanks
Sep 7 '12 #1
0 1623

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Simon Dahlbacka | last post by:
Hi, I'm doing some preparation for a hopefully upcoming transition to python 2.4 (from 2.3.4) on winxp platform However, I'm getting SyntaxErrors in files that worked fine in 2.3, it tells me...
0
by: vsaraog | last post by:
Hi y'all, I am using a Created Global Temporary Table in DB2 OS/390 version 7.1.2. I am inserting some data in it and then updating the table using ODBC but while I try to update it, I am...
2
by: Christina Grabe via AccessMonster.com | last post by:
Here's the code: Private db As Database, rs As Recordset Set rs = db.OpenRecordset("Table") rs.AddNew 'User puts in some stuff in form and hits okay rs.Update This stuff works perfectly...
2
by: Mesut KoÅŸucu | last post by:
hi all i get a error when update user attributes the error is "General access denied error " the code is Dim strAttrName As String = Me.TextBox1.Text Dim strAttrValue As String =...
2
by: KCHighland | last post by:
We have an ASP.NET application that permits anonymous access and runs as the IUSR account. The application accesses a SQL Server database located on a different server. All the data access code is...
1
by: Lars Netzel | last post by:
Hi! I'm deleting a row by filter it out from a dataview that is made from a dataset table. Use the DataView.Item(0).Row.Delete() method after it's filtered out and then I delete it thru...
21
by: Peter Nurse | last post by:
I have just upgraded to SQL Server 2005 from SQL Server 2000. In Microsoft SQL Server Management Studio, when I click on database properties, I receive the following error:- Cannot resolve the...
4
by: GreggaR0und | last post by:
Hello; I've created a form in InfoPath 2003. One of the fields is intended to be programmatically assigned as it is the next sequential key to the underlying database. I finally have...
3
by: Jeff Floyd | last post by:
This question was probably asked before but I could not find it. I have fields defined as memo in an Access 2000 database. I am using a form for data entry and then running an update query from a...
4
by: DragonLord | last post by:
I have a strange situation, I am looping through a datagrid view and updating the database with the results from each row that is timestamped when it is selected. foreach (DataGridViewRow...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...

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.