Solved

SQL Query retuns the strange error.

Posted on 2010-09-14
7
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

630 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