DataSet rows being deleted, but after the update , the sql database is not updated. The delete rows still in the database.

 Stepping thru the code with the debugger shows the dataset rows being deleted.


After executing the code, and getting to the page presentation. Then I stop the debug and start the

page creation process again ( Page_Load ).    The database still has the original deleted dataset rows.

Adding rows works, then updating works fine, but deleting rows, does not seem to work.


The dataset is configured to send the DataSet updates to the database. Use the standard wizard to create the dataSet.



cDependChildTA.Fill(cDependChildDs._ClientDependentChild, UserId);

        rowCountDb = cDependChildDs._ClientDependentChild.Count;

        for (row = 0; row < rowCountDb; row++)

           dr_dependentChild = cDependChildDs._ClientDependentChild.Rows[0];
            /* update the Client Process Table Adapter*/
          // cDependChildTA.Update(cDependChildDs._ClientDependentChild);
      //     cDependChildTA.Update(cDependChildDs._ClientDependentChild);


        /* zero rows in the DataSet at this point */

        /* update the Child  Table Adapter */

6/5/2007 2:16:24 AM 91979 articles. 4 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 42


You should use AcceptChanges method after using delete in order to update the data. The following link may be helpful to you.


Michael Jin.
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
6/7/2007 7:34:00 AM

Similar Artilces:

VS2005 - using detailsview to update, insert and delete rows from SQL 2005 database. Delete and insert work but update does not
  Using VS 2005 DetailsView to insert, delete, and update rows in SQL 2005 database.  insert and delete work but update does not.  I recieve no errors and the detailsView comes back unchanged (as well as table row is unchanged).   I am trying to use as little code behind as possible. However I do have ItemUpdating routines that seem to work (i.e Checking table for new login duplicates and encrypting passwords).  The following is the source code generated by VS2005:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="frmDbRegionMgr...

ask database on deleting if some row references another row (= database.Can_I_delete_some_table_row?)
Hello, is there way to ask database if I can delete some table row? I have tables with foreign key constraints and I need "try delete" some row in this table. But there is possibilitythat the row is referenced by another table, so it throws an exception.. I now that I can use in my .net code try, catch statement to catch unpossibility of execution sql statement...but It makes me feel that this is "hard" way (throwing exception, catching..) -- maybe here is another more efficient way.. I need do that: IDbConnection connection = Connection;// ask database ...

Problem with update when updating all rows of a table through dataset and saving back to database
Hi, I have an application where I'm filling a dataset with values from a table. This table has no primary key. Then I iterate through each row of the dataset and I compute the value of one of the columns and then update that value in the dataset row. The problem I'm having is that when the database gets updated by the SqlDataAdapter.Update() method, the same value shows up under that column for all rows. I think my Update Command is not correct since I'm not specifying a where clause and hence it is using just the value lastly computed in the dataset to update the entire databas...

Delete rows in SQL database using
Pls help: I have two tables: Tb and seller In the seller table: these are the following fields:ContactNo,StudentName,AdminNo,Serialcode In the tb table : these are the fields : Title, Author, Serialcode ***Each Title has its own unique Serialcode I wish to delete ContactNo, StudentName, AdminNo, Serialcode when i choose the particular Title. I not sure of the coding to delete rows....Pls help Coding: Dim objConnection As New SqlConnection(strConnection) Dim strSQL As String = "DELETE Seller.AminNo, Seller.ContactNo, Seller.StudentName, Seller.Serialcode FROM Sel...

rows are not deleting from database using dataadapter.update method
 Hi i am using dataset inside a session and using dataadapter.update method to update in database this is working fine when i am inserting rows in this dataset and updating it but when i am deleting row by using this method it is updating in dataset but not updating in database.the similar thing is working in another form very fine.i am explaining it again.there are two button insert and update.I am inserting record in grid and using dataset for this purpose and store this dataset in session variable so that it is globly available after postback.when i click a update button then this da...

Trying to delete a row, I get "Row changed between retrieve and update."
Hi Trying to delete a row I get the following error message and can't figure out why. Please see error below and any suggestion will be appreciated. Thanks Error message and part of the script: Row changed between retrieve and update. No changes made to database. DELETE FROM q_code_cause WHERE code = 1 AND ... Ok I found the Problem! Thanks anyway "Wasap" <> wrote in message news:3f96a7a5@forums-2-dub... > Hi > > Trying to delete a row I get the following error message and can't figure > out why. Ple...

TableAdapter not updating the DataTable in Dataset (insert is ok, but delete and update rows fail)
Hi, Let me try to define the situation; In the page i have a grid and save button I have a DataTable named "dt" and a TableAdapter named "ta" in my website project I have a Dataset named "DataSet1" in my App_Code folder as VS2005 suggested. In my Dataset1 , ihave a TableAdapter with "Fill,GetData" queries Also in my TableAdapter i have generated the InsertCommand, SelectCommand, UpdateCommand, DeleteCommand with DBDirectMethods I have bought a component named Janus Gridex, which has nice grid features that i like to use but the...

insert,update,delete row in gridview without saving in database
Hi  i am inserting,updating and deleting rows in a databound gridview but not saving record in database at the time of insert,update or delete butwhen i have complete all operation on gridview then there is a save button when i click this button then the gridview is saved in database.i am doing this by the help of dataset and datatable and i have stored this dataset in a session variable.this is working fine but i want to know is this a correct method.Is this may take heavy memory on server.Is there any other method for doing this.   Its depends upon the number of rows/records h...

(Fwd) How to loop through a database, row by row, and select and update one row at a time
----- Forwarded message from Troy Mulder <> ----- Date: Mon, 12 Apr 2010 17:48:37 -0400 From: Troy Mulder <> To: Subject: How to loop through a database, row by row, and select and update one row at a time Hello Tim (is it Dr. Bunce?), My name is Troy Mulder, and I am trying to get a perl script to interface with a PostgreSQL database. I am trying to step through each row of the database, and read one column of the row, and update another column of the row. When I follow the online tutorial a...

Delete Row Method (getting the primarykey of row being deleted)
Hello friends,I'd like to retrieve the primary key of the row being deleted so i can use it as a parameter in my stored procedure: Here's how far i have come with my code. I need help with line 6.Thanks in advance :)  1 Protected Sub DependentsObjectDataSource_Deleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles DependentsObjectDataSource.Deleting2 3 'get value of deleting depednent id4 'Delete (Unenroll) all benefits dependent enrolled in before attempting to delete dependen...

update: how to delete a row only if the row is selected first
i have tried everything to get past this error and im finding it hard to delete a row from my database, can any1 help? code so far - delete with confirmation:   <asp:GridView ID="GridView1" runat="server" AllowPaging="True" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="fileID" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" OnRowDeleting...

why the size of the database become bigger when I deleted all rows of the database
I used sqlanywhere database to store some pictures in a long binary field , the database file became very big soon , when I want to shrink the size of the database file , I deleted all rows , however the database file became bigger (In this database I didn't use a log file),who can tell me why ? Thanks! Bo, Deleted rows are not removed until you rebuild the database. I don't know why the database got bigger, but I'm sure that if you rebuild the database, it will physically remove the deleted rows. Richard Bo Song wrote in message +ADw-3733CA2D.7D...

Delete (Hide) Row from Gridview without deleting from DataBase
I am populating some data in a GridView.I added a column with a checkbox.Now I want to generate a sort of print-preview...When Ich check some buttons and hit my printpriview button. I only want these (selected rows displayed).How can I do this?The checkbox thing is already working What I basically need is something to delete data temporaly from a GridView (not Database).I tryed GridViewRow.Dispose() which worked but then the paging was still implementet and the user sees still all pages =(I have tryed GridViewRow.Enabled = false which only turned the colors =(I have used GridViewRow.Visible ...

DataSet update not working with deleted rows?
I have a DataSet that I seem to be able to add everything to fine bute when I call this to delete the row usersDS.Tables["users"].Rows.Remove(usersDS.Tables["users"].Rows[userIndex]) And then call the .Update method on my DataAdapter nothing happens, and the Row still remains. Am I using the Remove method wrong? Use the datarow's Delete() method to delete a row. This marks that row's DataRowState as Deleted so when the Update method comes along later it will know to issue the DataAdapter's DeleteCommand for that row.usersDS.Tables["users"].Rows[u...

Web resources about - DataSet rows being deleted, but after the update , the sql database is not updated. The delete rows still in the database. -

Database - Wikipedia, the free encyclopedia
A database is an organized collection of data . The data are typically organized to model aspects of reality in a way that supports processes ...

Database - Wikipedia, the free encyclopedia
... requiring information. For example, modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies. Database ...

Five million customers affected by Vtech database hack
Toy and educational material seller Vtech has revealed five million customers were affected by a hack of its app database and has also suspended ...

Ben Carson calls for database of all foreigners in US
Boston Herald Ben Carson calls for database of all foreigners in US Boston Herald Republican presidential candidate, Dr, Ben Carson, center, ...

Donald Trump wants "surveillance of certain mosques," database of refugees - Videos - CBS News
... rally in Birmingham, Alabama, Republican presidential candidate Donald Trump called for increased scrutiny over mosques, along with a database ...

Old database dump from Nexus Mods circulating in criminal circles: Change password
Nexus Mods, a gaming site which has mods for 216 games , warned users about a “ potential database breach ” after a Reddit user was alerted by ...

Trump Wants A Database For All Syrian Refugees Who Enter America
Trump Wants A Database For All Syrian Refugees Who Enter America

Change your passwords: NexusMods suffers database breach
... security breach by posts on reddit. Cybersecurity firm REN-ISAC had apparently contacted several university IT departments about a database ...

US Republican rivals blast Donald Trump for Muslim database comments
US Republican rivals blast Donald Trump for Muslim database comments - Donald Trump said he would implement a database to keep track of Muslims ...

VTech Admits Lack of Database Security Opened Door to Hack
A SQL injection, a common software flaw, was found to be the root cause in the VTech breach.

Resources last updated: 12/10/2015 5:22:54 PM