473,405 Members | 2,272 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,405 software developers and data experts.

MySqlCommandBuilder not updating the removed rows.

4
Hi, i have writen the following code:

Expand|Select|Wrap|Line Numbers
  1. string mySqlCommandString = "SELECT * FROM fxs_prueba";
  2. MySqlDataAdapter mySqlDataAdapter = new MySqlDataAdapter();
  3. mySqlDataAdapter.SelectCommand = new MySqlCommand(mySqlCommandString, mySqlConnection);
  4. MySqlCommandBuilder mySqlCommandBuilder = new MySqlCommandBuilder(mySqlDataAdapter);
  5.  
  6. mySqlConnection.Open();
  7.  
  8. DataTable myDataTable = new DataTable("Test");
  9. mySqlDataAdapter.Fill(myDataTable);
  10.  
  11. myDataTable.Rows.RemoveAt(2);
  12.  
  13. int rowsAffected = mySqlDataAdapter.Update(myDataTable);
  14.  
  15. mySqlConnection.Close();
  16.  
But the database table is not updated. The row is still there.
It works perfect when i insert a row or modifie a row and then call the Update method.
I do not get any exceptions, it just is not working.
I use the MySQL Connector Net 5.0.6
and the table uses the MyISAM engine
What am i doing wrong?

Thanks in Advance
Felix
Jul 11 '07 #1
2 3156
nfxs
4
Hellooo!!
Anyone?
(is it now 20 chars long?)
Jul 25 '07 #2
r035198x
13,262 8TB
Hellooo!!
Anyone?
(is it now 20 chars long?)
Aren,t you supposed to call some refresh method like AcceptChanges or something fo the changes to show?
P.S I think this is best handled in the .NET forum so I'll copy it there.
Jul 25 '07 #3

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

Similar topics

6
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the...
1
by: Srinadh | last post by:
Hi all, We have files with about 20 to 30 fields per row. We are trying to update such files with about 60 rows as contiguous data in a CLOB field. It passes through. But when we try...
3
by: | last post by:
I am trying to Delete records from Fox Pro Free Tables (.DBF) using C#. I am able to insert and view data with no problems but when I try to delete - no luck. It appears that I need to run a...
1
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... ...
1
by: gaDev | last post by:
1) I build a Html Table dynamically (Header Row, and then 2 rows with data All 2 rows have 2 cells: cell(0) contains a delete button (ASP Button), cell(1) contains a HTML Text box 2) On Form Load...
2
by: UKuser | last post by:
Hi Folks, I havent used javascript in ages, and am not the worlds guru, but I'm playing with ajax linking to my database and an updating area. I have an area named display for example which...
3
by: nfxs | last post by:
Hi, i have writen the following code: string mySqlCommandString = "SELECT * FROM fxs_prueba"; MySqlDataAdapter mySqlDataAdapter = new MySqlDataAdapter(); mySqlDataAdapter.SelectCommand = new...
0
by: deathprincess | last post by:
Hi Guyz, Need some help in updating my data grid view. I used the Rows removed and selection changed events. i have a code on the selection changed events and it worked well but the code on...
2
by: raulbolanos | last post by:
Hi Pr0's, I have a problem trying to implement the same example from this link: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommandbuilder.aspx But instead of Sql I use...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.