By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,526 Members | 2,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,526 IT Pros & Developers. It's quick & easy.

Formatting Data within a dataset

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.