473,607 Members | 2,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySqlCommandBui lder not updating the removed rows.

4 New Member
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 3164
nfxs
4 New Member
Hellooo!!
Anyone?
(is it now 20 chars long?)
Jul 25 '07 #2
r035198x
13,262 MVP
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
5762
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 use of checkpoints (for simple recovery and Backup Log for full recovery). On several website people speak about full transaction log and the pace of growing can't keep up with the update. Therefore we want to create a script which flushes the...
1
5943
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 updating files with about 60 to 200 rows, we get the
3
24297
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 "Pack" command but I receive the error "File must be opened exclusively." on the Pack Command. The code is below and the first command "Delete From Progress" marks all rows for deletion but does not remove them. I've tried Exclusive=On but still...
1
2460
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... mem_id integer primary key lastname nvarchar(30) firstname nvarchar(30)
1
2977
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 and get some data from a dataset and then from it's contents build the page At this point the page is rendered and 2 rows are displayed. There is an Add button that a user can click to add another row to the table. This works fine and the row...
2
1633
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 lists each entry (from a PHP/MySQL db) with a remove button at the end of each record which feeds a unique ID to my ajaxfunction below: function ajaxFunction(rec){
3
1300
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 MySqlCommand(mySqlCommandString, mySqlConnection); MySqlCommandBuilder mySqlCommandBuilder = new MySqlCommandBuilder(mySqlDataAdapter); mySqlConnection.Open(); DataTable myDataTable = new DataTable("Test");
0
970
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 RowsRemoved only clears the datagridview, it does not update its contents. Here's the code: int n = featureDataGridView1.SelectedRows.Index; if (feature.Parameter.Count != 0) { ...
2
3327
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 MySql. When I fill the DataSet with the data from the DB I dont have any trouble I can even fill also a DataGridViewer and display the data in my form. The problem is when I want to use the GetUpdateCommand. I get an exception error like "Dynamic...
0
8049
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
7985
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
8463
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
8322
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...
1
5997
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
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
3953
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...
0
4013
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2461
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.