【发布时间】:2016-08-13 20:58:10
【问题描述】:
希望对来自 2 个不同 sql 存储过程(都返回一个集合)的结果集使用相同的数据集。还是更容易更改 commandtype.text("exec my_sp1; exec my_sp2;") ?想保留 CommandType.StoredProcedure ... 处理此问题的最佳方法是什么?
Dim ds As DataSet = New DataSet()
Dim dt As DataTable = New DataTable
cmdSQL1.CommandType = CommandType.StoredProcedure
cmdSQL1.CommandText = ("my_sp1")
cmdSQL2.CommandType = CommandType.StoredProcedure
cmdSQL2.CommandText = ("my_sp2")
Dim da As New SqlDataAdapter(cmdSQL1)
da.Fill(ds) ... ?
【问题讨论】:
-
这与sql-server或数据库无关。所以我删除了这些标签。请正确使用标签