Temp Table not found or Doesn't exists !!!!

  • Thread starter Thread starter Ahmed Jewahar
  • Start date Start date
A

Ahmed Jewahar

Hi,

In a WEB form (.aspx.vb), I have created a Temporary table (SQL 2K
Server) using command object. Command object statement execute with
errors !.

But, when I try to read that Temporary Table (#tmp) upon creating of the
same, system popup with an error message saying that "#Tmp doesn't exist
in the DATABASE !" !!. Error look like that it is trying to find the
#Tmp in the DATABASE which my "Con1" using as Initial Catalog.

I don't have any problem while doing the same in classical ASP. Am I
missing anything ?.

Please assist...

Many thanks in advance...
 
Ahmed Jewahar said:
Hi,

In a WEB form (.aspx.vb), I have created a Temporary table (SQL 2K
Server) using command object. Command object statement execute with
errors !.

Do you really mean "with" errors, or is that a typo? If there are really
errors,
what do they say?
 
It's not a syntax error !. It's system.data.exception errors.

Following are the statments I execute from my applicaiton:

cmd1.commandText= "select *into #Tmp from myTable"
cmd1.Connection = cn1
cmd1.ExecuteNonQuery*

Above statement executed with no errors.


cmd1.CommandText = "select count(*) from #Tmp"
cmd1.Connection = cn1
dim RowsReturned as Int32 = Ctype(cmd1.ExecuteScalar,Int32)

While executing above statement, sytem popup with an error message
saying that "#Tmp Table Doesn't exists in the Database !!!"

Hope above make sense...

Regards,
 
Back
Top