animated405
asked on
syntaz error?
new to c#. I have a methof that just does some work so it does not return anything. when i load the page I get this error:
System.Data.SqlClient.SqlE
and it highlights the myCommand.ExecuteNonQuery;
what's wrong here, code below...thanks in advance!!
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = new SqlConnection(Configuratio
myCommand.CommandText = "up_add";
myCommand.Parameters.Add("
myCommand.Parameters.Add ("@product_id", SqlDbType.Int).Value = ProductID;
myCommand.Connection.Open(
myCommand.ExecuteNonQuery(
myCommand.Connection.Close
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok, I get it. If I want to pass in the actual sql then I would use the commandtext, I was confusing that with something else.
thanks very much!!