Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Query retuns the strange error.

Posted on 2010-09-14
7
Medium Priority
?
229 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 143

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 143

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 143

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

885 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