Andi03 Posted September 15, 2003 Posted September 15, 2003 Hi. I use a datagrid to present my info from my db. In my db (Access) I have a filed name RegDate (datatype Date/time). I use this SQL to get the date. "SELECT RegDate As Registration FROM tblMembers" The I present the info from db into the datagrid. But The date is formated like this: 2003-09-15 00:00:00 But in the database the date is this: 2003-09-15... Why does the datagrid add 00:00:00 (it just zeroes)??? Plz...help me... //Andi Quote
Moderators Robby Posted September 15, 2003 Moderators Posted September 15, 2003 look here http://ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpcondatetimeformatstrings.htm Quote Visit...Bassic Software
Moderators Robby Posted September 15, 2003 Moderators Posted September 15, 2003 Do you have the .NET help files installed? Quote Visit...Bassic Software
Andi03 Posted September 15, 2003 Author Posted September 15, 2003 I don't have VS.NEt installed but I have .NEt framework 1.1 SDk Quote
Moderators Robby Posted September 16, 2003 Moderators Posted September 16, 2003 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp Quote Visit...Bassic Software
andrewsc Posted September 16, 2003 Posted September 16, 2003 PMJI, it is preferable to jump in rather than starting a new thread with an identical question. Yes, I can see the local help file, but the problem comes at an earlier point in the design. Perhaps the original question also come from this angle. I've created a datagrid at design time, and now I need to specify something like: - the format for column 2 is "dd-MMM-yyyy HH:mm:ss" - the format for column 7 is "dd-MM-yy" The point is not whether the formats above are correct, or whether I identify a column by name or by number. From VB6 practice, I've expected a Columns collection hanging off the datagrid or the OleDbAdapter. Could not find such thing. How do I access properties for individual columns in a datagrid ? Andrew Quote
Moderators Robby Posted September 16, 2003 Moderators Posted September 16, 2003 If you are doing this at design time then add a property to the 'asp:BoundColumn'... something like this... DataFormatString="{0:g}" Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.