0

Hello,
I have date saved as varchar (Day,DD,MM,YYYY)in my database(DB) and it is displaying on my DB binded datagrid. I have binded it through VS.NET 2008. Is there any way I can get the sorting of my datagrid from date?
Please tell me the possible solutions for it.
Thanks
Adnan

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by abelLazm
0

If you want to convert your record in sql you can try the following code

--dt = '20/6/2010'
SELECT id, name, CONVERT(datetime, dt) from users

When data is entered in grid in VS here varchar is treated as String following code will help you in VS (c# code)

DateTime dt;
dt = Convert.ToDateTime(myDateTimeString);
0

i wonder why my post got -ve vote :?

Sorry In a hurry I got the negative pressed. All this time I am searching how to change it.

1

:D leave it that's ok if your problem is solved.... Please mark this thread solved

Edited by abelLazm: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.