Data Parameters
-
I am having a significant brain block... I am trying to take a string variable and use that as the criteria in a select statement to a sql 2000 database. I have tried the parameters collection in the data adapter but I cannot seem to get it to work. HELP.... Thanks Bob Gronenthal
-
I am having a significant brain block... I am trying to take a string variable and use that as the criteria in a select statement to a sql 2000 database. I have tried the parameters collection in the data adapter but I cannot seem to get it to work. HELP.... Thanks Bob Gronenthal
-
Tried the Select method on the DataTable? Better even might be to modify the SelectCommand.CommandText on your DataAdapter. It's hard to say more without more details about what you are trying to do and how... Hope this helps, Bill
I have a vb.net program that is polling 911 data for new entries by a position number. When the user 'logs into the program' he/she puts the position number that they are at. I need the latest 911 data to populate there screen by position number. I am storing their logon entry as a public variable so that I can user it anywhere in the project to 'tag records' by them. I would like the select statement to use this variable to only retrieve the records for that position. Thanks, Bob
-
I have a vb.net program that is polling 911 data for new entries by a position number. When the user 'logs into the program' he/she puts the position number that they are at. I need the latest 911 data to populate there screen by position number. I am storing their logon entry as a public variable so that I can user it anywhere in the project to 'tag records' by them. I would like the select statement to use this variable to only retrieve the records for that position. Thanks, Bob
Hi Bob, I am guessing you have a DataAdapter somewhere(maybe created when you dragged a table onto the form designer?). I'll assume it's named DataAdapter1, though yours might not be. Somewhere in your program you have code that looks like:
DataAdapter1.Fill(DataSet1)
orDataAdapter1.Fill(DataTable1)
What you might want to try is, just before you call the fill do something like:DataAdapter1.SelectCommand.CommandText = "select * from WHATEVER_YOUR_TABLE_NAME_IS where YOUR_COLUMN='" & THE_VARIABLE & "'"
Bill