Solved

SQL Query retuns the strange error.

Posted on 2010-09-14
7
216 Views
Last Modified: 2012-05-10
hi,



I am having  a strange problem. I a musign ASP.net  and SQL server.  I am receving the following error in my page when tryign to get resutls(view suppliers orders) from database.

": System.Data.SqlClient.SqlException: The multi-part identifier "o.created" could not be bound."

the strange thing is this does not happen all the time and not on all the machine. when i looked in to the function whrere  the query is  there is no column name like "o.created" used in query. i double checked the i am looking into the right source file.

when you close the internet explorere and open the applicaltion again adn go to the same page it will work fine.

Any idea what is wrong. thsi happens only on one machine. thsi works fine on other users machine.
0
Comment
Question by:Redshelf
  • 3
  • 3
7 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 33672098
that error means you have an error in the T-SQL.

if it does not happen all the time, it means that the query is build differently ...

please post the SQL when it happens
0
 
LVL 7

Expert Comment

by:meispisces
ID: 33672211
its a common error in SQL Server Query.

P.S.: Please make sure your spelling written are correct.Its very difficult to read.

Thanks
0
 

Author Comment

by:Redshelf
ID: 33672408
hi there,

this is the query i am using.

"SELECT orderItems.*, orders.created, orders.status, orders.memberid, orders.dateRequired, orders.paymentDate FROM orderItems, orders, suppliers WHERE orderItems.orderID = orders.orderID AND orderitems.supplierID = suppliers.supplierid AND orders.companyID=@companyID AND (orderItems.supplierID LIKE '%' + @supplierID + '%' OR suppliers.alphasearch LIKE '%' + @supplierID + '%').

Sorry for the spelling mistakes. I was being panic about the error.

regards

0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 33672601
that query cannot raise the error, because "o.created" means you have a table name or alias that reads "o"...
which is not in the query.
please review ...
0
 

Accepted Solution

by:
Redshelf earned 0 total points
ID: 33672642
sorry,

I found the problem. it was the session variable which was appended in the query having the sort by "o.created".

thanks for the time.

Nitesha
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 33672936
well, we have pushed you to review the code/query :)
glad you found the issue
0
 

Author Comment

by:Redshelf
ID: 33680240
thanks angell..
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now