|
|
 |
| ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
|
 |

April 17th, 2009, 10:31 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2007
Location: , , .
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
|
|
Need Help with Convert SQL.
Hi
I am using a typed dataset and I using Convert to try to trim one of my datetimes to just date(I am using mssql2005).
So I have something like this in my sql query.
CONVERT(varchar, ExpiryDate, 101) AS ExpiryDate
Now when I run it in the query builder it trims it down to just the date but when I run it live it still has the time.
I am attaching it to a grdivew. So first I made a bound field:
BoundField endDate = new BoundField();
endDate.HeaderText = "Expiry Date";
endDate.DataField = "ExpiryDate";
Then I return a datatable from my 3 tier architecture and use this as the Datasource and then bind it but I keep getting it with the time included.
Did I do something wrong?
|

April 17th, 2009, 11:26 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,040
Thanks: 5
Thanked 44 Times in 43 Posts
|
|
I don't remember how to do it, but add a format property to add format to the field.
__________________
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the proof.
================================================== =========
|

April 18th, 2009, 01:26 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2007
Location: , , .
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
|
|
ff
Quote:
Originally Posted by gbianchi
I don't remember how to do it, but add a format property to add format to the field.
|
format property?
|

April 18th, 2009, 01:30 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,040
Thanks: 5
Thanked 44 Times in 43 Posts
|
|
Sorry my mistake, I was thinking directly in the field in the grid. It has a format property. At any point, someone is changing how your data is showed, and that is probably the grid. All the times are equal or you see the correct time in the grid???
__________________
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the proof.
================================================== =========
|

April 18th, 2009, 02:23 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2007
Location: , , .
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
|
|
Quote:
Originally Posted by gbianchi
Sorry my mistake, I was thinking directly in the field in the grid. It has a format property. At any point, someone is changing how your data is showed, and that is probably the grid. All the times are equal or you see the correct time in the grid???
|
Yep it seems to be correct just has the time with it that I don't want.
|

April 18th, 2009, 09:18 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,040
Thanks: 5
Thanked 44 Times in 43 Posts
|
|
And if you take out the convert from the query, it shows the same values??? this is weird, unless you are not using the SQL you think you are using.
__________________
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the proof.
================================================== =========
|

April 18th, 2009, 02:58 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2007
Location: , , .
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
|
|
Quote:
Originally Posted by gbianchi
And if you take out the convert from the query, it shows the same values??? this is weird, unless you are not using the SQL you think you are using.
|
Yep. Only time it changes is in the preview window of the sql query builder.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |