大神们指导一下,这段代码错到哪了?
vb.net吧
全部回复
仅看楼主
level 1
Dim con As SqlClient.SqlConnection = New SqlClient.SqlConnection(ConnectionString)
Dim tmpDS As New DataSet
Dim tmpDA As New SqlClient.SqlDataAdapter("GetPageData", con)
con.Open()
With tmpDA.SelectCommand
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@viewName", SqlDbType.NVarChar, 800).Value = viewName
.Parameters("@recordTotal").Direction = ParameterDirection.Output
End With
tmpDA.Fill(tmpDS, "a")
tmpDS.AcceptChanges()
'recordTotal = tmpDA.SelectCommand.Parameters("@recordTotal").Value
'执行到这里是正确的,recordTotal有返回值,证明存储过程被正确执行了
MsgBox(tmpDS.table(0).Rows.Count) ''可执行到这里,却总没有数据被填充到table中。
con.Close()
2016年01月17日 16点01分 1
level 1
补充:有没有有能,我的存储过程只返回了总记录数,但没返回具体记录集?(在SQL 执行过程,是可以列出记录集结果的)。
2016年01月17日 16点01分 2
1