sql存储过程定义字段
@RetValue int out
as
 select @RetValue=xxxx  from .......

cs代码:
SqlCommand com = new SqlCommand("存储过程名",con对象);//建立SQL命令
com.CommandType = CommandType.StoredProcedure;//指定使用SQL存储过程
com.Parameters.Add("@RetValue", SqlDbType.Int).Direction = ParameterDirection.Output;//得到存储过程返回值

int rv = Convert.ToInt32(com.Parameters["@RetValue"].Value);//定义值接收
posted on 2006-11-16 16:49  路过秋天  阅读(2322)  评论(4编辑  收藏  举报
路过秋天