Results 1 to 11 of 11

Thread: how to add a record to database

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Location
    Manila, Philippines
    Posts
    486

    how to add a record to database

    hi! i am using access as my database, what i want to know is how to add, edit and do a simple query in c#
    i am a new to c# just want to learn a little work around. just a sample will do.
    thanks alot!

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

    Re: how to add a record to database

    If you want to learn that stuff I would recommend using the Data Form Wizard. Right-click your project in the Solution Explorer and select Add New Item. From the template list select Data Form Wizard. The wizard will then ask you a series of questions and, based on your answers, create a form that contains all the objects you need retrieve, display and update data. You can then play around and explore the code 'til your heart's content. Note that the Provider for a connection to an Access database is Microsoft Jet 4.0 OLE DB Provider. You'll see when it is needed. Also, you'll need at least a basic understanding of SQL, which I'm guessing you have already.

  3. #3
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: how to add a record to database

    c# and vb.net are just the same when it comes in inserting records to the database.

    if you know vb.net saving records to the database then you have no worries when it comes to c#.

    and oh i always get rid of wizard coz i dont know what its doing. I love to hardcode it so that i know what's going on.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Location
    Manila, Philippines
    Posts
    486

    Re: how to add a record to database

    but i don't know in vb.net either, you coul please provide me an example. just a simple one will do. thanks

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

    Re: how to add a record to database

    Quote Originally Posted by mar_zim
    c# and vb.net are just the same when it comes in inserting records to the database.

    if you know vb.net saving records to the database then you have no worries when it comes to c#.

    and oh i always get rid of wizard coz i dont know what its doing. I love to hardcode it so that i know what's going on.
    I never use the Data Form Wizard myself, but if an example of how to use a database in a .NET app is required, isn't that exactly what the wizard would provide?

  6. #6
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: how to add a record to database

    we can't deny that using wizard is so easy because it will do all your work just provide some connection to it. But the sad part is that you don't know what was going on or what technique it uses. Many of the newbie's uses data wizard that they don't know what's going on. Me too im a newbie in databases but i never used data wizard. If you want to start programming in databases much better if you hardcode it. They're lots of things you learn when you hardcode it.

    Unless you're very good in databases then use wizard coz you already know what's going on.
    And yeah data wizard are used to communicate your app's to the database.

    and oh kulitag if have a time tomorrow then i will post some samples regarding your problem.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Location
    Manila, Philippines
    Posts
    486

    Re: how to add a record to database

    anyone please! need it badly!

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Location
    Manila, Philippines
    Posts
    486

    Re: how to add a record to database

    bump!

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

    Re: how to add a record to database

    Have you tried the Data Form Wizard? If not, is there a particular reason? It will create the same code that an example from someone else will provide anyway.

  10. #10
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    Re: how to add a record to database

    The best way is to use stored procedures if you are using SQL server or Oracle. If not then use an sql string.
    steve

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to add a record to database

    Quote Originally Posted by kulitag
    anyone please! need it badly!
    This should help.

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