create procedure datretrieveproductsxml
as
select * from products
for xml auto
go
1 void getproductdetails( int productid,
2 out string productname, out decimal unitprice )
3 {
4 using( sqlconnection conn = new sqlconnection(
5 "server=(local);integrated security=sspi;database=northwind") )
6 {
7 // set up the command object used to execute the stored proc
8 sqlcommand cmd = new sqlcommand( "datgetproductdetailsspoutput", conn )
9 cmd.commandtype = commandtype.storedprocedure;
10 // establish stored proc parameters.
11 // @productid int input
12 // @productname nvarchar(40) output
13 // @unitprice money output
14
15 // must explicitly set the direction of output parameters
16 sqlparameter paramprodid =
17 cmd.parameters.add( "@productid", productid );
18 paramprodid.direction = parameterdirection.input;
19 sqlparameter paramprodname =
20 cmd.parameters.add( "@productname", sqldbtype.varchar, 40 );
21 paramprodname.direction = parameterdirection.output;
22 sqlparameter paramunitprice =
23 cmd.parameters.add( "@unitprice", sqldbtype.money );
24 paramunitprice.direction = parameterdirection.output;
25
26 conn.open();
27 // use executenonquery to run the command.
28 // although no rows are returned any mapped output parameters
29 // (and potentially return values) are populated
30 cmd.executenonquery( );
31 // return output parameters from stored proc
32 productname = paramprodname.value.tostring();
33 unitprice = (decimal)paramunitprice.value;
34 }
35 }
1 create procedure datgetproductdetailsspoutput
2 @productid int,
3 @productname nvarchar(40) output,
4 @unitprice money output
5 as
6 select @productname = productname,
7 @unitprice = unitprice
8 from products
9 where productid = @productid
10 go
创造与魔法 安卓版v1.0.0750
创造与魔法是一款开放世界手游,在游戏中玩家可探索这个奇妙的世
创造与魔法修改版 最新版v1.0.0750
创造与魔法无限点券版是款探索冒险游戏,该款游戏的操作还是蛮自
战争与文明官方版本 安卓版v1.7.16
战争与文明是一款由上海邮通科技有限公司开发的战争策略游戏,这
迷你世界0元领皮肤无限迷你币版 最新安卓版v1.43.0
迷你世界0元购买皮肤版是这款开放沙盒冒险建造游戏的特殊破解版
创造与魔法无限经验版 安卓版v1.0.0750
创造与魔法无限经验版是款可以改造环境,整个游戏的自由度还是蛮