Hi all,
i am working on a project whereby i am required to insert, update and delete of customer details in a database. I am using a textbox to do a progressive search on the handphone numbers inside the database whereby if the handphone number exists inside the database, it will display the customer details in the textboxes i have created. Handphone number is a column in my database table. After i delete the specific row of the table, the handphone number of the deleted row still existsin the textbox, i have tried the clear method to empty the source and using a fill method to retrieve the data again but its not working, here are the codes:
Any help would be deeply appreciated,
Charles
Dim nameCommand As SqlCommand = conn.CreateCommand()
nameCommand.CommandText = _
"DELETE FROM CustDetail WHERE RmuNum = '" & txtSearch.Text & "'"
nameCommand.ExecuteNonQuery()
da.Fill(ds, "CustDetail")
Me.txtSearch.AutoCompleteCustomSource.Clear()
Me.txtSearch.AutoCompleteMode = AutoCompleteMode.Suggest
'The data source is filled programmatically.
Me.txtSearch.AutoCompleteSource = AutoCompleteSource.CustomSource
'Create the custom source.
Me.txtSearch.AutoCompleteCustomSource = New AutoCompleteStringCollection()
'Get the DataTable.
dt = ds.Tables("CustDetail")
'The column we want to help the input.
Const suggestColumnIndex As Integer = 3
'Traverse the rows and and the suggest values.
For Each row As DataRow In dt.Rows
Me.txtSearch.AutoCompleteCustomSource.Add(row(suggestColumnIndex).ToString())
Next
MsgBox("Client data Deleted")