我SQL数据库有一个存储过程,如下:CREATE
PROCEDURE Hrdtest01
As
declare @Temp table(
BillNo nvarchar(20)
,ProductNo nvarchar(20)
,ProductName nvarchar(100)
,Specification nvarchar(100)
)
Insert Into @Temp(BillNo,ProductNo,ProductName,Specification)
Select BillNo,ProductNo,ProductName,Specification from ERun_8..PD_Product
Where ProductNo Like '374%'
Select BillNo as 单据编号,ProductNo as 料号,ProductName as 品名,Specification as 规格
from @Temp Order by ProductNo
Go
然后在Foxtable的代码如下:
Dim sqlstr02 As String = "Exec Hrdtest01"
Dim cmd As New SQLCommand
cmd.ConnectionName = “sqlname”
cmd.CommandText = sqlstr02
Dim dt As DataTable = cmd.ExecuteReader
MessageBox.Show(dt.DataRows.Count)
Tables("SQLTest_Table1").DataSource = dt
运行后,发现
dt.DataRows.Count=0
而且加载表也是不存在的表!
请问该如何可以读取sql中的表变量的结果!非常感谢大虾们!!!