Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 191
  • Last Modified:

Entering data into an access database

Hi all:

I attempting to enter data into access database from a textbox control.  I am able to bind the textbox control to a specific field in the database, but after that I don't know how to get the data to move to the database. Basically I am trying to get the text from the textbox1 into the binded field in the database. If there are any questions please ask.  Here is the code for the form so far.

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

   
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = ""
        DataSet11.Clear()
        OleDbDataAdapter1.Fill(DataSet11)

    End Sub

    Private Sub OleDbDataAdapter1_RowUpdated(ByVal sender As System.Object, ByVal e As System.Data.OleDb.OleDbRowUpdatedEventArgs)

    End Sub

    Private Sub DataGrid1_Navigate(ByVal sender As System.Object, ByVal ne As System.Windows.Forms.NavigateEventArgs) Handles DataGrid1.Navigate

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        If RadioButton1.Checked Then
            TextBox1.Text = "GM"
        End If
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        If RadioButton2.Checked Then
            TextBox1.Text = "Ford"
        End If
    End Sub

    Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
        If RadioButton3.Checked Then
            TextBox1.Text = "Toyota"
        End If
    End Sub
End Class
0
sonicamps
Asked:
sonicamps
  • 2
1 Solution
 
RonaldBiemansCommented:
just do
 
 me.bindingcontext(DataSet11).endcurrentedit
 OleDbDataAdapter1.Update(dataset11)
0
 
RonaldBiemansCommented:
or update the specific table like

me.bindingcontext(DataSet11.tables(0)).endcurrentedit
 OleDbDataAdapter1.Update(dataset11.tables(0))
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now