I have a code where it will store values from textbox to gridview temporarily without sending to database.
Now i have created a button,trying to send the values in temporary gridview to database.
Here's the cs code :
|
But i'm getting this error:
CS1061: 'System.Data.SqlClient.SqlCommand' does not contain a definition for 'Parameter' and no extension method 'Parameter' accepting a first argument of type 'System.Data.SqlClient.SqlCommand' could be found (are you missing a using directive or an assembly reference?)
Source error:
cmd.Parameter.AddWithValue("@compName", row["name"].ToString());
I tried to use command instead of cmd,but it still gives error.
Any ideas guys?
Sam HobbsPosted Sep 17, 2010, 9:18 PM
Parameter
Parameters
Do you see a difference? Now look at your code, the error message and the documentation.
Sam HobbsPosted Sep 19, 2010, 9:45 PM
samPosted Sep 19, 2010, 9:23 PM
Hi.
Now i get another error :
ExecuteNonQuery: Connection property has not been initialized.
source line :
Even in my other applications get this error.And as i know,the code is just ok.But i dont know why getting this error.