Results 1 to 8 of 8

Thread: Writing to database

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2009
    Posts
    53

    Writing to database

    Hi everyone.

    First off this is the first time i have ever used VB. I am trying to write a program for work.

    I have created a form in VB where the user enters data into text boxes and rich text boxes.

    Please could somone tell me how to do the following:

    When the user clicks the "save" button, the data they have entered in the text boxes gets saved into an excel or access database for later viewing.

    All help is greatly appreciated!

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Writing to database

    There are complete examples for this in the FAQ section at the top of the Database fourm
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2009
    Posts
    53

    Re: Writing to database

    Hi thanks for the reply, iv had a look around the FAQ section but i have no idea where i am looking. Please could you point me to the post that explains what i need?
    Many thanks.

  4. #4
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Writing to database

    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2009
    Posts
    53

    Re: Writing to database

    Hi,
    I dont understand any of that post.
    Some of the questions running through my head are:
    Do i use that code?
    Where do i place the code?
    What do i put in place of "connection string here"?

    I am a complete beginner at this. I created my form simply by using "drop and drag" in VB.
    Thanks.

  6. #6
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Writing to database

    No one here will write this for you. You must make an attempt post errors you get. The code you write, what goes wrong, what you expected and what line it errors on.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  7. #7

    Thread Starter
    Member
    Join Date
    Sep 2009
    Posts
    53

    Re: Writing to database

    Hi,
    Im sorry i may have misled you.
    I do not wish anybody to write this code for me. Im a wizz at html css etc and i have been on forums many times and know how the system works.

    Im simply after a few quick instructions of how to get the form i have created to write the fields to the database in Visual Basic 2008 Express Edition.

    For example if i wanted to create a text box, i wouldnt be expecting anybody to provide the code for me, id be after something like the following:

    1. Click the toolbox button which is towards the right hand side of the toolbar.
    2. Select "text box" from the list.
    3. Click on the form where you want to place the textbox.

    Thanks

  8. #8
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Writing to database

    What you asking will depend on how you go about connecting to and getting data from the database.

    I you use wizard then thing go one way, if you connect manually and do every thing in your own code it chages a little.

    You the code will go in varoius places, on form load you coud place code that would fill a datagrid with information from a database (or textboxes), could might need a binding datasource if the data is expected to automaticly change in the textboxs when you scroll though a datatable (something returned from the database).

    You could on a button click event add code to that will insert/update/delete to the database on your own. Or you might have an Insert/Update/Delete that is connected to the data adapter (that will fill a datatable).
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

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