473,324 Members | 2,178 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,324 software developers and data experts.

Convert a latebinded DataTable column's format from DateTime to string (or format the date time value)

RSH
Hi,

I have a situation where I am using a dataset from a SQL Query. SQL's
DateTime is a "long date/time field" which includes the Date/Time. My
fields need to be displayed in a short time format "08:00" instead of
"1/1/1900 08:00 AM"? I can't alter the database table, I only want to
change the displayed value. How do I either change the datatable's column
datatype to a string...or specify the columns formatting?

How can I achieve this formatting to

Dim Con As OleDbConnection = New OleDbConnection(strCompanyConn)

oDA = New OleDbDataAdapter(spSQL, Con)

Dim myDataSet As New DataSet

oDA.Fill(myDataSet, "Shifts")

If myDataSet.Tables("Shifts").Rows.Count = 0 Then

Con.Close()

Con = Nothing

Else

Me.GridEX1.DataSource = myDataSet.Tables("Shifts")

Me.GridEX1.DataBind()

Con.Close()

Con = Nothing

End If

Thanks!

Ron


Dec 6 '06 #1
0 1606

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

Similar topics

1
by: William Kossack | last post by:
I have a table with a date/time field that is not required. The actual purpose of the field is to indicate when something was stopped. Therefore, in my select select field1, field2, dtfield from...
2
by: tariq | last post by:
Hi, Any knows how i can strip a Date time object of the time value in it. My current approach is tempdate = DateTime.Parse(tempDate.ToShortDateString()); Looks quite nasty. Anyone knows of...
4
by: Tiraman | last post by:
Hi , I Would Like To Convert Some HEX Data to string format and opposite . does vb.net has some functions for that ? 10x -- Best Regards ,
2
by: bh | last post by:
Changing a Date Time Value I have a form with a date time picker or it and a button. When the button is pressed it passes the date/time into a stored procedure that queries an SQL database. ...
14
by: eric.goforth | last post by:
Hello, I'm trying to convert a string to a date time in a C# web service. I'm passing in a string parameter and I have a localization setting in my Web.config file: My app is blowing up on...
2
by: john | last post by:
From an Excel-import I have an access table with a datetime field of wich both date and time are entered. I've set the field's notation properties to Short Date. When I view the table in tableview...
3
by: sorci-engine | last post by:
"Problematical RFC 822 date-time value: Sat, 28 apr 2007 19:05:00 +0200". This tell me the "FEED Validator". I made a search through site forums and precedent messages of xml groups, but I found...
6
by: dmorand | last post by:
I've got two fields in my database. There are date and time fields, but they are both type text. I need to concatenate these fields together and convert them to a date/time data type. I've tried a...
1
by: unnikrishnan123 | last post by:
C# code for storing a selected date time value to a variable. using a DateTimePicker.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.