String SQL = "movedata ";
Mcmd = dB. getstoredproccommand (SQL );
DB. addinparameter (mcmd, "@ State", dbtype. int32, 2 );
DB. addparameter (mcmd, "@ RET", dbtype. byte, parameterdirection. returnvalue, "", datarowversion. Default, null );
Mcmd. Parameters ["@ RET"]. Value
1. Add Parameters
Public voidAddparameter(Dbcommand command, string name, dbtype, parameterdirection direction, string sourcecolumn, datarowversion sourceversion, object value );
DB. addparameter (mcmd, "@ return", dbtype. byte, parameterdirection. returnvalue, "", datarowversion. Default, null );
DB. addparameter (mcmd, "@ return", dbtype. byte, parameterdirection. returnvalue, null, datarowversion. Default, null );
Note: The second parameter name must be @ variable name. Otherwise, the system automatically adds
Parameterdirection. returnvalue specifies the return value.
2. Run
DB. executenonquery (mcmd );
3. Values
Dbtype. byte x = mcmd. Parameters ["@ return"]. value;
From: http://www.cnblogs.com/zfh424/archive/2009/02/03/1383507.html