Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my project im using a datagridview using visual studio and my problem is the date column will not display anything. when i checked my database in mysql the date values are there but in the datagridview its just blank. all the other fields are visible. How do i get the date to show in my datagridview?
Posted
Comments
joshrduncan2012 10-Oct-12 13:15pm    
Can you provide your code for us to look at so we can pinpoint the problem? Without seeing your code, it's very difficult to decipher what you are talking about.
ridoy 10-Oct-12 15:41pm    
share your code here..

Hi,

If you are using asp:BoundField, here is it.
Be sure that the field column of your Date is exactly what your defind in:
DataField="REQST_DATE" and set "Allow Zero Datetime" to true in your connection.

Example in your client code:
<asp:BoundField DataField="REQST_DATE" HeaderText="Requested Date" ItemStyle-HorizontalAlign="Left"
  HeaderStyle-HorizontalAlign="Left">
  <HeaderStyle HorizontalAlign="Left" />
  <ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
 
Share this answer
 
v4
Please see this article, it can help you much. Hope it works.
GridView all in one[^]
 
Share this answer
 
You can see question about "Date Time Format In Data GridView" in:
C# - DateTime format question in DataGridView . Hope it help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900