Link to home
Start Free TrialLog in
Avatar of Redshelf
RedshelfFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

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
its a common error in SQL Server Query.

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

Thanks
Avatar of Redshelf

ASKER

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

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 ...
ASKER CERTIFIED SOLUTION
Avatar of Redshelf
Redshelf
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well, we have pushed you to review the code/query :)
glad you found the issue
thanks angell..