Wednesday, March 21, 2012

parameter in sp

I am passing 'class_ID' in a hyperlink from a datagrid to a details page

I am trying to add a parameter to a stored procedure @dotnet.itags.org.class_ID

In the code behind parameter, however, it says that class_ID is not defined and I don't know how to define it?

cmd.Parameters.Add(New SqlParameter("@dotnet.itags.org.class_ID", SqlDbType.int, 4))
cmd.Parameters("@dotnet.itags.org.class_ID").Value = request.querystring("class_ID")

all help gratefully received.
Thanks
JeffPlease give more details such as the exact error message and the SQL statement you are using.
maybe this will work better?

SqlParameter p = new SqlParameter("@.class_ID", SqlDbtype.Int, 4);
p.Direction = ParameterDirection.Input;
p.Value = request.querystring("class_ID");

cmd.Parameters.Add(p);


?

0 comments:

Post a Comment