'SqlCommand' does not contain a definition for 'Parameters' and no extension method 'Parameters' accepting a first argument of type 'SqlCommand' could be found (are you missing a using directive or an assembly reference?)
Sqlcommand Error
how i can remove this type of error from code?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Mayur DigheRank #1,078 · 1.8K reputationPosted Dec 21, 2012, 6:27 AM EST
you can do this.........buddy....
just ENSURE that you are NOT passing any Blank Query through SqlCommand Object; ...
I think you are using Stored Procedures for executing query...so ..just make sure that...you are NOT missing ANY Parameter(s) required for that Stored Procedure;
Example of adding Parameters of Stored Procedure to SqlCommand object:
SqlCommand cmd=new SqlCommand("StoredProcedureName");
...
...
cmd.Parameters.Add(); --or--
cmd.Parameters.AddWithValue()
Try.. what you like....or which work for you....
VulpesRank #55 · 29.2K reputationPosted Dec 21, 2012, 8:58 AM EST
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx
Can you post the line of code where that error occurs.