using system; 【相关文章:第四章 账号和组管理(Solaris认证】
既然我们已经看了类与成员,让我们来看一下基本的实施情况.接下来的代码是一个简单的情况,使用事务来保证两个存储过程-一个从表中删除库存,另一个增加库存在另个表中,或同时执行,或失败. 【扩展阅读:DirectX发展回顾】using system.drawing; 【扩展信息:第四章 账号和组管理(续3)(Solar】 using system.collections; using system.componentmodel; using system.windows.forms; using system.data; using system.data.sqlclient; using system.data.sqltypes;…public void sptransaction(int partid, int numbermoved, int siteid)
{ // create and open the connection. sqlconnection conn = new sqlconnection(); string connstring = "server=sqlinstance;database=test;" + "integrated security=sspi"; conn.connectionstring = connstring; conn.open();// create the commands and related parameters.
// cmddebit debits inventory from the warehouseinventory // table by calling the debitwarehouseinventory // stored procedure. sqlcommand cmddebit = new sqlcommand("debitwarehouseinventory", conn); cmddebit.commandtype = commandtype.storedprocedure; ... 下一页