SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Select Error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Pao-Pao
Starting Member

Philippines
3 Posts

Posted - 06/03/2004 :  21:37:15  Show Profile  Send Pao-Pao a Yahoo! Message  Reply with Quote
I did a query statement in c# but the number of rows returned by the query is less than the number of rows when i run the query in query analyzer... how was this possible? the select statement carries the same condition....

SQLSelectAgent.CommandText = "SELECT tblAgentConfig.Tenant_Num, tblAgentConfig.Agent_Num, tblAgentConfig.Agent_Group_Num, tblAgentConfig.Agent_Name, tblAgentConfig.Agent_Init, tblAgentStatus.Logon_Time, tblAgentStatus.Current_Mode, tblAgentStatus.Time_Current_Mode, tblAgentStatus.ACD_Call_Count, tblAgentStatus.ACC_Talk_Time, tblAgentStatus.ACC_Work_Time, tblAgentStatus.ACC_Break_Time, tblAgentStatus.AHT FROM tblAgentConfig JOIN tblAgentStatus ON tblAgentConfig.Agent_Num = tblAgentStatus.AgentNum_FK convert(char(10), [time_stamp], 101)BETWEEN '" + dateFormater(momment.Month, momment.Day - 1, momment.Year, "day") + "' AND '" + dateFormater(momment.Month, momment.Day, momment.Year, "day") + "'";

vito1281
Starting Member

12 Posts

Posted - 06/03/2004 :  21:50:29  Show Profile  Reply with Quote
A couple of things to consider/check...

1. Is the .net application connected to the same database instance? In our environment, we sometimes have multiple copies of a given db (for testing purposes), and the web.config can get changed around quite a bit. This is one of those "check that the power cord is plugged in" things.

2. Start up SQL Profiler, and see what query hits the server when you make a call from the .NET application. You should be able to compare that against the query analyzer query you were referring to.

See if that helps.

quote:
Originally posted by Pao-Pao

I did a query statement in c# but the number of rows returned by the query is less than the number of rows when i run the query in query analyzer... how was this possible? the select statement carries the same condition....

SQLSelectAgent.CommandText = "SELECT tblAgentConfig.Tenant_Num, tblAgentConfig.Agent_Num, tblAgentConfig.Agent_Group_Num, tblAgentConfig.Agent_Name, tblAgentConfig.Agent_Init, tblAgentStatus.Logon_Time, tblAgentStatus.Current_Mode, tblAgentStatus.Time_Current_Mode, tblAgentStatus.ACD_Call_Count, tblAgentStatus.ACC_Talk_Time, tblAgentStatus.ACC_Work_Time, tblAgentStatus.ACC_Break_Time, tblAgentStatus.AHT FROM tblAgentConfig JOIN tblAgentStatus ON tblAgentConfig.Agent_Num = tblAgentStatus.AgentNum_FK convert(char(10), [time_stamp], 101)BETWEEN '" + dateFormater(momment.Month, momment.Day - 1, momment.Year, "day") + "' AND '" + dateFormater(momment.Month, momment.Day, momment.Year, "day") + "'";

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000