Updaing records in database table after searching ?!

  • Thread starter Thread starter Kevin993
  • Start date Start date
K

Kevin993

Guest
My databse has one table named "_members" , and it has some rows , each for a member record and info , and it has some columns like firstname , email address and ... .

I use the code below to search for input string in a desired field of my database table and then I populate my datagridview with the result :

Dim SearchJob As String = txtinput.Text

Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\data.mdb;Persist Security Info=False;")

Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM _members WHERE FirstName Like '%" & SearchJob & "%' ", con)


con.Open()
Dim myDA As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim myDataSet As DataSet = New DataSet()
myDA.Fill(myDataSet, "_members")
DataGridView1.DataSource = myDataSet.Tables("_members").DefaultVie

If I click F2 in a selected field of datagridview , I can change the shown value. But how to save the edits in database too

Thnx

Continue reading...
 
Back
Top