No definition for parameter error

Posted 16 September 2010 - 08:40 PM

Hi.
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?

This post has been edited by eclipsed4utoo: 17 September 2010 - 04:40 AM
Reason for edit:: please use the code tags... [code] your code here [/code]