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

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...
 
H

Hans Kesting

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?
 
A

Ahmed Jewahar

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top