'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?
VulpesPosted Dec 21, 2012, 1:58 PM
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx
Can you post the line of code where that error occurs.
Mayur DighePosted Dec 21, 2012, 11:27 AM
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....