Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a parameter to a SqlDataAdapter

Status
Not open for further replies.

RichS

Programmer
Apr 24, 2000
380
US
How do you do this?

I have a page with the SqlDataAdapter, SqlConnection and a DataSet bound to the DataAdapter. (I can get this to work in another page that uses a SP without a parameter.) In the SqlDataAdapter I set the Parameter in the SqlParameter Collection Editor but I get the following error:

Input string was not in a correct format.
Line 60: SqlDataAdapter1.Fill(DataSet21)


even tho i have set it to an int in the SqlParameter Collection Editor and where I access the value from the request object.

Thanks In Advance
Rich
 
SqlDataAdapter1.SelectCommand.Parameters("parameterName").value = "value"

Should get you up and running. From your post I assumed that you already created the parameter so this should work. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top