Last post Nov 09, 2015 12:33 AM by sun21170
Nov 08, 2015 11:37 PM|micah2012|LINK
Am having error on this line of code, the error is the name CommanType does not exist in the current context,
MYPOST does not exist in the current context
cmd.CommandText = MYPOST; //this should be the name of the stored procedure which is MYPOST and not a SELECT query
cmd.CommandType = CommmandType.StoredProcedue;
return dt; (ERROR- Can not leave the body of a final clause)
Nov 09, 2015 12:33 AM|sun21170|LINK
There was a missing parenthesis in my original code, which I have corrected. You can get the latest code. Also note the below points.
Call the method as shown below and make sure that the id value is also a string representing some id in the database.
When using stored procedure name always enclose the name of stored in quotes as below.
cmd.CommandText = "MYPOST";