ADO.NET - no database change

Discussion in 'C#' started by Talikag, Aug 28, 2010.

  1. Talikag

    Talikag New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi. I'm using Visual Studio 2010 professional and .Net framework 4.0, and I have this weird problem with ADO.NET.

    I created an OleDB database for test purposes. A dataset was automatically generated by VS, and I used it to delete/update/insert data.
    For example, here's a code I wrote to remove all the records from a table named "Departments":
    Code:
               CoursesDBTableAdapters.DepartmentsTableAdapter da = new CoursesDBTableAdapters.DepartmentsTableAdapter();
                CoursesDB.DepartmentsDataTable dt = new CoursesDB.DepartmentsDataTable();
                da.Fill(dt);
                foreach(DataRow row in dt.Select())
                    row.Delete();
                da.Update(dt);
    
    It works fine. The records are indeed getting deleted. But after like a minute, when I run the program once again, the original data (the records that have been deleted) finds it's way back into the database.
    Any ideas what might cause that?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice