G
Guest
Hello,
If I say this:
Dim cmd As New SqlCommand("select top 10 * from tbl1, conn)
conn.Open()
Dim reader As SqlDataReader = cmd.ExecuteReader()
everything is OK. But if I try this:
Dim cmd As New SqlCommand
conn.Open()
cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select top 10 * Into #temp1 From tbl1") <---complains here
cmd.ExecuteNonQuery()
cmd.CommandText = "Select * From #temp1"
Dim reader As SqlDataReader = cmd.ExecuteReader()
..Net complains. Is there a way to use #temp tables with ado.net? How to do
this?
Thanks,
Rich
If I say this:
Dim cmd As New SqlCommand("select top 10 * from tbl1, conn)
conn.Open()
Dim reader As SqlDataReader = cmd.ExecuteReader()
everything is OK. But if I try this:
Dim cmd As New SqlCommand
conn.Open()
cmd.Connection = conn
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select top 10 * Into #temp1 From tbl1") <---complains here
cmd.ExecuteNonQuery()
cmd.CommandText = "Select * From #temp1"
Dim reader As SqlDataReader = cmd.ExecuteReader()
..Net complains. Is there a way to use #temp tables with ado.net? How to do
this?
Thanks,
Rich