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:
00661918
Views:
22
>HI Mike,
>
>>SELECT HINIT,HNAME FROM HWHOA WHERE (HINIT = @hinit)
>
>From "Parameters in Data Adaptor Commands" in the doc, my understanding is that named parameters (@hinit) are only used with the sqldataadapter and that the placeholder (?) is only used with the oledbdataadapter. Im using the latter.
>
>The querybuilder actually would not let me enter a named parameter. At any rate, I added "Hinit" to the parameter collection of my oledbdataadapter and it seemed accept the place holder.
>
>No errors when I run the form but still not getting anything in the data set. Have to keep playing.
>
>Thanks for your help!
>
>Todd

Yes you are right, use the ? with oledbdataadapter (Humm, there are still data sources other that SQL server in use <s>).

SELECT HINIT,HNAME FROM HWHOA WHERE (HINIT = ?)

You should still get the parameter(s) generated by the wizard. To check go to oledbdataadapter properties, selectcommand, parameters collection. You should see the created parameter list. To test go to oledbdataadapter properties and select preview data. Add in the desired parameter values and hit Fill Dataset. You should get the data returned (At least it works for me).
Michael McLain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform