Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Invalid Object Name" 1

Status
Not open for further replies.

jl280328

Programmer
Joined
Jun 15, 2006
Messages
97
Location
US
I am trying to pull information from a SQL database using C#. Here is the code that I am using:
Code:
Conn = new SqlConnection( @"Server=WEBSERVERW2K; UID=sa; PWD=39x9iVu1; DataBase=Dealer Quoter Dev;" );
				Conn.Open();
				SQL="SELECT * From ReportGlue";
				Comm = new SqlCommand( SQL, Conn );
				SQLReader = Comm.ExecuteReader();
				Conn.Close();

However I keep getting an error stating that there is an "Invalid Object Name" and it refers to the table name 'ReportGlue' I was just wondering what could be causing this, because the tablename exists in the DB and the page will render if I comment out this line
Code:
SQLReader = Comm.ExecuteReader();

 
However I keep getting an error stating that there is an "Invalid Object Name"
What type of error? Is it a SQLException or a .NET error?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
SQL Exception

System.Data.SqlClient.SqlException: Invalid object name 'ReportGlue'
 
Then that table does not exist in the DB you are querying
 
Or the user you are accessing the database as doesn't have access to the table.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top