Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem w/parameterized sql stmt
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00661706
Message ID:
00663846
Views:
24
Hi Mike,

I should restate, previewing the data works fine but creating the dataset gives the error "Retreiving the schema for Oledbdataadapter1 failed! No value given for one or more parameters." I removed the parameters from the Select statement and it allows me to create the dataset, then I added the parameters back to the Select statement. At that point all seems well.

Then I added a textbox (textbox1) and button on the form and added this code to the button click event:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'OleDbDataAdapter1.SelectCommand.Parameters("hinit").Value = TextBox1.Text
OleDbDataAdapter1.SelectCommand.Parameters("hinit").Value = "BWP"
DsHoa1.Clear()
OleDbDataAdapter1.Fill(DsHoa1)
DataGrid1.DataBind()
End Sub


Notice that I tried hard coding the parameter value. I cannot get a parameterized search to work from the click event. If I remove the parameter from the select statement, it will load and display the entire table just fine.

So close and yet so far...

Todd
The day you take complete responsibly for yourself, the day you stop making any excuses, thats the day you start to the top. - O.J. Simpson

Great advice from a questionable source...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform