missing sqlparameter add method
Hi guys, Im trying to follow this sample of inserting data through gridview rowcommand. But somehow Im missing the sqlparameter add method whilst the namespace was already added.
Code:
//sqlparameter declaration of list type
private List<SqlParameter> insertParameters = new List<SqlParameter>();
mygridview_rowcommand(...){
SqlParameter _prm_guid = new SqlParameter("@pk_guid", SqlDbType.VarChar);
_prm_guid.Direction = ParameterDirection.Input;
_prm_guid.Value = thisguid;
insertParameters.add(?); //error on add()
}
Some other part of the code which related to insertParameters variable it give an error
Code:
for statement cannot operate on variables of type List<System.Data.SqlClient.SqlParameter> because List<System.Data.SqlClient.SqlParameter> does not contain a public definition of GetEnumerator
Am I missing a file reference? Appreciate an help.
Re: missing sqlparameter add method
insertParameters.add(_prm_guid);
Did you try the above one?