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

Formatting Data within a dataset

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 presuming using some sort of
format)

any help would be greatly appreciated
Mike Fellows
Nov 20 '05 #1
5 3924
Cor
Hi Mike,

What is the control you are using and are you using binding?

Cor
i wish to format the 3rd column which contains a date field
but it shows the date as dd/mm/yyyy 00:00:00

Nov 20 '05 #2
Hi,

I would format it when I display the value.

http://msdn.microsoft.com/library/de...asicprimer.asp

http://msdn.microsoft.com/library/de...ormattopic.asp

Ken
------------------------
"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:dyl1c.97$m56.9@newsfe1-win...
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 presuming using some sort of
format)

any help would be greatly appreciated
Mike Fellows

Nov 20 '05 #3

Below is my function that i need to format the Dataset in
i need to format ds.tables(0).columns.item(2) but i have no idea how to do
it
Function LeadReceivedNoMortgageSourced(ByVal Datagrid As
System.Web.UI.WebControls.DataGrid, ByVal Title As String)
Dim conn As New System.Data.SqlClient.SqlConnection(SQLstrConn)
Dim sql As String = "LeadReceivedNotMortgageSourced"
Dim da As New System.Data.SqlClient.SqlDataAdapter(sql, conn)
Dim ds As DataSet = New DataSet()
ds.Tables(0).Columns.Item(0).ColumnName = "ID "
ds.Tables(0).Columns.Item(1).ColumnName = "Surname "
ds.Tables(0).Columns.Item(2).ColumnName = "Date Lead Received"
ds.Tables(0).Columns.Item(2).ColumnName.Format("o: d")
da.Fill(ds)
Datagrid.DataSource = ds.Tables(0)
Datagrid.DataBind()
Title = "Lead Recieved Not Mortgage Sourced"
End Function
thanks
Mike
"Cor" <no*@non.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Mike,

What is the control you are using and are you using binding?

Cor
i wish to format the 3rd column which contains a date field
but it shows the date as dd/mm/yyyy 00:00:00


Nov 20 '05 #4
Cor
Hi Mike,

You got a nice link from Ken, I asume if you not post back that that is the
solution

Cor
Nov 20 '05 #5
Read up on DataGrid.TableStyles
"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:dyl1c.97$m56.9@newsfe1-win...
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 presuming using some sort of
format)

any help would be greatly appreciated
Mike Fellows

Nov 20 '05 #6

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

Similar topics

8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
5
by: Kevin C | last post by:
I was curious to know what some developers out in the industry are doing when it comes to exposing Data access logic, specifically persistence. This is assuming that your not using an O/R framework...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
1
by: msmcg | last post by:
I need to format the data in some textboxes using the Binding method with custom Currency and ShortDate format and parse handlers. Here is the code that I am using. I call it on the form load...
0
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...
2
by: serge calderara | last post by:
Dear all, I have an ASP.NET 1.1 application which show data collected from an sql database inside a datagrid bind to a dataset which contains all data retrive. I need to display ki^nd of...
3
by: Aaron | last post by:
Hi, It is possible to establish relationships between tables within a dataset and this allows some useful features. For example, given a row from a table you can use GetParentRow,...
5
by: AAJ | last post by:
Hi all FIRST THE BORING BITS....... I normally use a Database layer, a Business layer and a GUI layer. The GUI uses an Object data source to bind to the Business layer which in turn binds...
14
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.