An SqlParameter with parametername "ID" is not contained by this SqlParameterCollection
Posted on 2006-05-04
i create a sqldataadapter in windows form and create a criteria for a column. I want to add parameter to dataadapter's selectcommand with column name but it gives an error.
"An SqlParameter with parametername "ID" is not contained by this SqlParameterCollection"
My select command which is created by dataadapter:
this.sqlSelectCommand1.CommandText = "SELECT ID, ad, soyad FROM tablo WHERE (ID = @Param2)";
And my code to add parameter to this command:
i don't want to access to this parameter with @param2 value, i want to access with ID value.
Thanks for help guys..