SQL Query retuns the strange error.

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.
RedshelfAsked:
Who is Participating?
 
RedshelfAuthor Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
meispiscesCommented:
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
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
RedshelfAuthor Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
well, we have pushed you to review the code/query :)
glad you found the issue
0
 
RedshelfAuthor Commented:
thanks angell..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.