date format

M

Mike

I have a date in my table format like YYYY/DD/MM 2004/7/7

but when I pull that value out of the table in .net and populate my grid it
looks like:

7/7/2004 12:00:00 AM

I don't want that, i want to see exactly how it is in my table. How do i
accomplish that with .NET so it does not change the format
 
K

Ken Cox [Microsoft MVP]

Hi Mike,

You can set the DataFormatString for your grid like this:

<asp:DataGrid id="DataGrid1" runat="server">
<Columns>
<asp:BoundColumn DataField="ADateTime" HeaderText="Date and Time"
DataFormatString="{0:yyyy/M/d}"></asp:BoundColumn>
</Columns>
</asp:DataGrid>

Does this help?

Ken
Microsoft MVP [ASP.NET]
Toronto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top