Click here to Skip to main content
15,923,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i run this code the following error is given
The best overloaded method match for 'System.Data.SqlClient.SqlParameterCollection.Add(string, object)

C#
dataAdapter.SelectCommand.Parameters.Add(@userId, SqlDbType.Int).Value = userId;


in this line error is given
Posted
Comments
vinodkumarnie 13-Apr-13 4:58am    
Do you included System.Data.SqlClient namespace...?

1 solution

Try:
C#
dataAdapter.SelectCommand.Parameters.Add("@userId", SqlDbType.Int).Value = userId;
Instead of
C#
dataAdapter.SelectCommand.Parameters.Add(@userId, SqlDbType.Int).Value = userId;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900