471,354 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Dataset column formatting

I have a dataset with a date field. The date format for the underlying SQL
server table is smalldatetime. When I bind the form's field to the dataset
column, it comes out as longdate (date with hours:minutes:seconds AM/PM). I
want the format to be MM/dd/yy.

Dim dt As New DataTable()
Dim dr As DataRow
dt = dataset.Tables(0)

For Each dr In dt.Rows
Dim dteDate As Date = dr("Date")
Dim strDate As String = Format(dteDate, "MM/dd/yy")
dr("sdate") = Date.Parse(strDate).ToShortDateString

It looks like sdate is converted to shortdate, but doesn't get to the form
in that format. How can I make sure that the dataset column stays in the
MM/dd/yy format?

Jul 21 '05 #1
0 1037

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Tom Vukovich | last post: by
4 posts views Thread by Andrew Chalk | last post: by
5 posts views Thread by Mike Fellows | last post: by
reply views Thread by JMorrell | last post: by
reply views Thread by Randall Arnold | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.