Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VB.Ne Writing to DB

Options
  • 02-02-2005 7:02pm
    #1
    Registered Users Posts: 1,052 ✭✭✭


    I'm trying to enter info on a product then svae it to the DB

    Part No: "TxtPartNo" save to Part_No Field in the tblProducts table in Access
    Title: "TxtTitle" save to Title Field in the tblProducts table in access
    etc....

    Part No: and Title: are lables, TxtPartNo and TxtTitle are text boxes.

    Age Rating: "cboAge" has 3,12,15 and 18 in the drop down list and i'm guessing this is a little different then writing the text from a text box!

    P.S. I really hate VB.net


Comments

  • Registered Users Posts: 1,259 ✭✭✭halkar


    Dim fromcboAge as String =cboAge.SelectedItem.Text

    Above will store the selected age and you can pass this to your database just as you are passing the text boxes. If cboAge storing the age as value then use 'SelectedItem.value' above.


  • Registered Users Posts: 2,758 ✭✭✭Peace


    You didn't really ask any questions in your post so until you do then carry on the fight!

    Thanks foir letting us know ;)


  • Registered Users Posts: 565 ✭✭✭Speedway


    hehe arent we having fun with this project Mr OmegaRed! (aka Norry boy) ;)


  • Registered Users Posts: 1,052 ✭✭✭OmegaRed


    Peace wrote:
    You didn't really ask any questions in your post so until you do then carry on the fight!

    Thanks foir letting us know ;)

    LOL! Yeah, I guess i didn't. It was probably cos i was so stressed out with .Net.....

    Basicly i want to enter data into a text box and click a save button so it will save the data in the database.

    So for example:

    Typing "Insert Cd title here" in the text box named 'txtTitle' then clicking save will save the data in the table 'tblProducts' under the field 'Title'

    How do you do this?


  • Registered Users Posts: 2,758 ✭✭✭Peace


    Well first you'll ned the SQl to do it..
    Inster into blah blah....

    Then you want to figure out what you want to use in .Net to execute the insert.

    MSDN Online is really good with code examples ..

    some options are datareader/data adapter... start with those and read throught the tutorials.


  • Advertisement
  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    OmegaRed wrote:
    How do you do this?

    Read up on DataAdapters and DataSets in Ado.net, and as Peace said look up SQL (Structured Query Language) too.

    For future reference its better if you've had a stab at a solution before you ask questions. At least then you've made an effort and may even have code to show people and ask questions about.


Advertisement