How to update data in MS-Access through vb.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pra tham
    New Member
    • Nov 2010
    • 2

    How to update data in MS-Access through vb.net

    i m new to vb.net please help me to update the database records through vb.net
  • osama Abboshi
    New Member
    • Nov 2010
    • 2

    #2
    hello

    Code:
    oledbdataadapter1.selectcommand.comandtext="Update () from tabel1 where Rec_number=value('" & textbox1.text &"')
    textbox1.text appear the recnumber when form Load

    Comment

    • Pra tham
      New Member
      • Nov 2010
      • 2

      #3
      what is selectcommand.. ?

      Comment

      • BRawn
        New Member
        • Jul 2010
        • 28

        #4
        selectcommand is a built-in method in the .net framework.

        Alternatively, what you can do is the following:

        Code:
        Public Sub updateUsers()
                Dim updateQuery As String = ("UPDATE Users SET UserName = "  _
                            + (txtUserName.Text.Trim + " WHERE UserID = 1"))
                Dim adapter As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
                adapter.SelectCommand.CommandText = updateQuery
            End Sub
        It's just an example to get you going. If you need anymore help just ask and someone will help you :)

        Comment

        Working...