c# - "Fatal error encountered during command execution." mysql-connector .net -
i using next code:
mysqltransaction trndata = pcondb.begintransaction(); mysqlcommand cmddata = new mysqlcommand(); cmddata.connection = pcondb; cmddata.commandtimeout = plngquerytimeout; cmddata.commandtype = commandtype.text; cmddata.commandtext = "call spsome( 4, 'data', 389552022,@intoutreturn);"; cmddata.transaction = trndata; plngrecordscount = cmddata.executenonquery();
isn't call
statement possible straight .net library? same query working on workbench.
change 2 lines this:
cmddata.commandtype = commandtype.storedprocedure; cmddata.commandtext = "spsome( 4, 'data', 389552022,@intoutreturn);";
you need add together parameter parameters collection of cmdata
@intoutreturn
parameter. won't give illustration of syntax varies databases , don't know mysql's looks like.
also, line:
cmddata.transaction = trndata;
..is necessary if doing other db operations should in same transaction. if you're not, i'd leave line out.
c# mysql .net mysql-connector
No comments:
Post a Comment