I posted some of my Programs code up here and long story short it wasn't quiet as good as I hoped. So I was shown a thread that might be able to help me. Link. This is a post by jmcilhinney, very smart and reasonably easy to understand. But I am having problems applying some of the ideas to my program.

What I was doing.

To retrieve my members list I have 3 text boxes and 1 date time picker as search options. The end user would type or pick information they wanted, and any relating members would become displayed inside of a data grid view.

Example code

vb.net Code:
  1. Private Sub PopulateCustomerData(ByVal QueryString As String)
  2.  
  3.         ' This Private Sub is used to pull the needed information out from the database.
  4.         ' The Sub is expecting a QueryString from any source.
  5.         ' Once the Sub has been given the QueryString it then uses this _
  6.         ' information to query the database and to populate the needed fields inside of the customer data section.
  7.  
  8. Dim Connstring As String = "Provider=microsoft.ACE.oledb.12.0;data source =  " & GetAppPath() & "GymMemberData.accdb"
  9.         Dim da As OleDbDataAdapter = New OleDbDataAdapter(QueryString, Connection)
  10.         Dim ds As DataSet = New DataSet
  11.         da.Fill(ds, "MemberInfo")
  12.  
  13.         tboFName2.Text = ds.Tables("MemberInfo").Rows(0).Item("FirstName").ToString
  14.         tboLName2.Text = ds.Tables("MemberInfo").Rows(0).Item("LastName").ToString
  15.         lblMemberID.Text = ds.Tables("MemberInfo").Rows(0).Item("MemberID").ToString
  16.         tboPhoneNumber.Text = ds.Tables("MemberInfo").Rows(0).Item("PhoneNumber").ToString
  17.         tboAddressLine1.Text = ds.Tables("MemberInfo").Rows(0).Item("AddressLine1").ToString
  18.         tboAddressLine2.Text = ds.Tables("MemberInfo").Rows(0).Item("AddressLine2").ToString
  19.         tboAddressLine3.Text = ds.Tables("MemberInfo").Rows(0).Item("AddressLine3").ToString
  20.         tboPostCode.Text = ds.Tables("MemberInfo").Rows(0).Item("AddressPostCode").ToString
  21.         cboCardIssued.Text = ds.Tables("MemberInfo").Rows(0).Item("CardIssued").ToString
  22.  
  23.         Connection.Close()
  24.  
  25.  
  26.     End Sub

Query string is set by this

vb.net Code:
  1. Private Sub txtLName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tboLName.TextChanged
  2.  
  3.         ' This Sub sends the Private Sub "PopulateGridVIew" a QueryString, _
  4.         ' that is then used to query the database against characters in the persons last name.
  5.  
  6.         PopulateGridView("SELECT FirstName, LastName, MemberID, startdate, " & _
  7.                          "CardIssued FROM MembersTable WHERE Lastname Like '" & _
  8.                          tboLName.Text & "%' AND MarkedforDeletion = False")
  9.  
  10.     End Sub

So I go to the database every time the user types anything, and I retrieve the needed information. Later on in the program the user then has the option to update and delete and create. Which is similar, it connects to the database and then updates the records.

My original problem was that I was then trying to repopulate the datagridview within the same update,delete and create button sub. But for some reason and I still have no idea why, it wasn't working.

jmcilhinney pointed out that I should be retrieving the data, storing it localy, editing it localy and then updating the database at the end. Fine, but can I get my head around how to do that? No.

His examples show you using a fixed Query, where as you can see in mine, it all depends on what the user types in. He also sets the DataAdapter and DataTable as open to the whole form, fine.=

Sorry I am waffeling on. What I am trying to say is that, I understand the idea behind all of his examples, but I am really struggeling to implement the examples into my code. And I am here asking for some help please guys .

I try and not ask for help but I am really stuck and confused here.