473,371 Members | 1,508 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,371 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 1106

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
by: Tom Vukovich | last post by:
and returning the xml to the requesting web page, how do you insert the XML declaration? ds.EnforceConstraints = False Response.ContentType = "text/xml" ds.WriteXml(Response.OutputStream,...
by: Andreas Palm | last post by:
I have a dataset that has DBNull in certain columns, now when I write out this one to XML, I only get the columns as elements that do have data in it. However I do need also the empty colums as...
by: Alex | last post by:
I have a dataset bound datagrid. I added my own columns (autogenerate=false). However I can't figure out how to display a hyperlink string coming from the DB as a functioning hyperlink. What can...
by: Alex | last post by:
I'm reposting my issue with some more info. I would like to use a DataGrid to display my DataSet. My DataSet is from a table in a SQL DB. Both columns in the table are strings. I would like...
by: Andrew Chalk | last post by:
I am displaying a dataset using a Repeater. I would like to allow the user to click on a column header and have the data sort by that column. How do I go about this? Does anyone know of any...
by: Mike Fellows | last post by:
I have a dataset wich contains 3 columns i wish to format the 3rd column which contains a date field but it shows the date as dd/mm/yyyy 00:00:00 i need to remove the time part of the data (i...
by: JMorrell | last post by:
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...
by: Randall Arnold | last post by:
I have a Microsoft Access report (built on a SQL Server 2000 query) I have exported as xml/html. I include a stylesheet in the original export for formatting of the report. The schema is...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.