在asp.net中如何获得SQL存储过程传回的多个输出参数(output)值? 在asp.net中如何获得SQL存储过程传回的多个输出参数(output)值? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Dim nwindConn As SqlConnection = New SqlConnection("Data Source=localhost;Integrated Security=SSPI;" & _ "Initial Catalog=northwind")Dim catDA As SqlDataAdapter = New SqlDataAdapter("SELECT CategoryID, CategoryName FROM Categories", nwindConn)catDA.InsertCommand = New SqlCommand("InsertCategory" , nwindConn)catDA.InsertCommand.CommandType = CommandType.StoredProcedureDim myParm As SqlParameter = catDA.InsertCommand.Parameters.Add("@RowCount", SqlDbType.Int)myParm.Direction = ParameterDirection.ReturnValuecatDA.InsertCommand.Parameters.Add("@CategoryName", SqlDbType.NChar, 15, "CategoryName")myParm = catDA.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 0, "CategoryID")myParm.Direction = ParameterDirection.OutputDim catDS As DataSet = New DataSet()catDA.Fill(catDS, "Categories")Dim newRow As DataRow = catDS.Tables("Categories").NewRow()newRow("CategoryName") = "New Category"catDS.Tables("Categories").Rows.Add(newRow)catDA.Update(catDS, "Categories")Dim rowCount As Int32 = CInt(catDA.InsertCommand.Parameters("@RowCount").Value) 关于form表单提交后跳转页面的问题 如何判断一个页面是刷新还是关闭? GridView的更新问题 如何在当前操作的电脑上备份access数据! 很急,在线等......解决立刻给分! 求详细的用二进制存图片,并且在页面上的显示的例子!!!!!!!!!!!!!!!!!!!! 关于用户自定义控件的问题 vb.net的web編程 DataGrid能否不显示表头? 怎样用datagrid隐藏列保存数据? 有关Sql server Analysis service的问题?高手请进 存储过程输出参数 再问web打印精确控制!
"Initial Catalog=northwind")Dim catDA As SqlDataAdapter = New SqlDataAdapter("SELECT CategoryID, CategoryName FROM Categories", nwindConn)catDA.InsertCommand = New SqlCommand("InsertCategory" , nwindConn)
catDA.InsertCommand.CommandType = CommandType.StoredProcedureDim myParm As SqlParameter = catDA.InsertCommand.Parameters.Add("@RowCount", SqlDbType.Int)
myParm.Direction = ParameterDirection.ReturnValuecatDA.InsertCommand.Parameters.Add("@CategoryName", SqlDbType.NChar, 15, "CategoryName")myParm = catDA.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 0, "CategoryID")
myParm.Direction = ParameterDirection.OutputDim catDS As DataSet = New DataSet()
catDA.Fill(catDS, "Categories")Dim newRow As DataRow = catDS.Tables("Categories").NewRow()
newRow("CategoryName") = "New Category"
catDS.Tables("Categories").Rows.Add(newRow)catDA.Update(catDS, "Categories")Dim rowCount As Int32 = CInt(catDA.InsertCommand.Parameters("@RowCount").Value)