Results 1 to 9 of 9

Thread: How to Add, Edit, and Delete Data in MS Access DB?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    78

    How to Add, Edit, and Delete Data in MS Access DB?

    What is the code I can use to add, delete, and edit data in the database?

    I'm new in C# and I'm trying yo create a program that is capable of adding, editing, and deleting data in the database. I'm using MS Access as my database.

    I don't know also how to browse the data stored. Can someone give me a code on how I can browse the data using a "Previous" and "Next" button?
    To become a PROFESSIONAL,
    Start from SCRATCH...

  2. #2
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: How to Add, Edit, and Delete Data in MS Access DB?

    everard:

    I don't think you are going to find many people here who are going to write your project for you, but they will help you if you have problem with the code you write.

    I would suggest that you download the "101 C# Samples" from the first listing in this Forum page. You will find a lot of sample code for database projects as well as a lot of other very useful information.

    Good Luck

  3. #3
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    Re: How to Add, Edit, and Delete Data in MS Access DB?

    First you have to create your Database, then create a connection from your program to the database. Finally, using that connection, send your SQL statements that will retrive, insert, delete or modify the data contained in the database.

    Jennifer.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    78

    Re: How to Add, Edit, and Delete Data in MS Access DB?

    I already have my database in MS Access and the connection was already done. My only problem is that I don't know how to add, edit, and delete records in the database. I also have the code for viewing the content of the database but I can't make it move from one record to another using the "Previous" and "Next" button. Thanks in advance.
    To become a PROFESSIONAL,
    Start from SCRATCH...

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: How to Add, Edit, and Delete Data in MS Access DB?

    As AIS4U said earlier, why don't you download the 101 samples?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6

  7. #7
    Lively Member fifo's Avatar
    Join Date
    Dec 2005
    Location
    HaiPhong, Vietnam
    Posts
    77

    Re: How to Add, Edit, and Delete Data in MS Access DB?

    In order to modifying your database, you should learn more about Command (such as InsertCommand, UpdatedCommand, DeletedCommand ) in DataAdapter. Like that

    Code:
    myConnection.myAdapter.UpdateCommand = new OleDbCommand(@"update tblUsers set [Name]=?,[Pass]=?, [Type]=? where [IdUser]=?", myConnection.myConn);
    This Command is very important to control the database.
    !Have fun!

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    78

    Re: How to Add, Edit, and Delete Data in MS Access DB?

    Where will I place that code?
    To become a PROFESSIONAL,
    Start from SCRATCH...

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to Add, Edit, and Delete Data in MS Access DB?

    There is no one code for data access. You should learn the principles from at least one tutorial and then apply those to your specific situation, asking for clarification from us on specific issues. Here's one such tutorial.

    http://quickstart.developerfusion.co...wcontents.aspx
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width