problem executing query

  • Thread starter Thread starter deepak
  • Start date Start date
D

deepak

Hi There,

i am facing problems while executing the query using ADO.NET,the
problem goes below:
i am using ExecuteDataset(sqlTran, CommandType.Text, query) and my
query is this

SELECT * FROM TBL WHERE CreatedDateTime = '1/23/2011 4:38:57.000 PM'

and the result set has nothing in it .but if i run the same query in
SQL SERVER 2005 studio
i get back the results .
am i missing some thing ,can anybody suggest.sql server and my
application are in different machine but both have the same
regional(en-us) and datetime settings(gmt+5:30)

Hope i am clear

Cheers
Deepak
 
Various thoughts:
1: are they using the same account to connect, and if not, is there a
"development" version of TBL that you are seeing with one account, but
seeing the "dbo" account from the other? common gotcha
2: "i18n"; a safer option is to use a parameterised value for @When,
and then you don't need to worry
3: Have you tried using a BETWEEN query (+/- 1 minute, for instance)
to see if it is some form of truncation?

Marc
 
Hi marc,

thanks for the suggestion,the problem was i was using a different DB
in my app.
Sorry for wasting ur valuable time

Cheers
Deepak
 
Well, that was bullet zero... I came *this* close (holds fingers apart
not very far) to including it... ;-p

Glad you are sorted,

Marc
 
Back
Top