the same thing in the first click, this is my code....
Private Sub txtNama_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles txtNama.MouseClick
Dim ds As New DataSet
Dim dt As New DataTable
Dim a As String = "SELECT NAMA, KURSUS FROM DAFTARPELAJAR WHERE NDP = @NDP"
Dim b As New OleDbDataAdapter(acscmd)
acscmd.CommandText = a
txtNama.Text = dt.Rows(0).Item(0)
txtKursus.Text = dt.Rows(0).Item(1)
this code only run in the first click, i dont know why.
Your first problem is that you have to use ? for parameters when you use OleDb so your query should be
Dim a As String = "SELECT NAMA, KURSUS FROM DAFTARPELAJAR WHERE NDP = ?"
When I try the code on my database (with the corrected query) it works just fine. If I type a new value in txtNDP and click on txtNama then the control gets updated. Incidentally, what you are doing is not called binding. You are just fetching a value and populating the textbox manually. You might as well just use a datareader.
oh, ok....thank for you information about populating the the textbox, i already try the query that you give, but after i run the code it will show error on line b.fill(dt) = Data type mismatch in criteria expression. That why im using parameter to solve the error.
i also try to clear the txtnama.text but when new ndp is filled and click at txtnama it still show the 1st clicked data.
its like the event running on 1st click only.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...