Formatting Datasets (and a quick question on datagrids)

Discussion in 'ASP .Net' started by Mike Fellows, Mar 3, 2004.

  1. Mike Fellows

    Mike Fellows Guest

    i have a function (shown below) that accepts a web datagrid and populates it
    with a dataset

    when i display my datagrid it shows the date as 00/00/0000 00:00:00

    i need to format the time from the end of the date

    i cant do this in the designer as the webform i use with the datagrid on
    uses many different functions so
    i cant format it with the designer

    code:


    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()
    da.Fill(ds)
    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"
    Datagrid.DataSource = ds.Tables(0)
    Datagrid.DataBind()
    Title = "Lead Recieved Not Mortgage Sourced"

    End Function



    also when i access a datagrid in a WINDOWS form i can do x =
    me.datagrid1.item(0,0)
    but how do i do this in a WEBFORM as the .item does not exist

    anyhelp with the above would be greatly appreciated

    Mike Fellows
    Mike Fellows, Mar 3, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Sweet

    Quick question re: DataSets

    John Sweet, Apr 18, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    575
    Val Mazur \(MVP\)
    Apr 19, 2005
  2. news.microsoft.com
    Replies:
    0
    Views:
    410
    news.microsoft.com
    Apr 12, 2006
  3. Francisco Garcia
    Replies:
    2
    Views:
    449
    Fran Garcia
    Apr 13, 2006
  4. news.microsoft.com
    Replies:
    0
    Views:
    174
    news.microsoft.com
    Apr 12, 2006
  5. Francisco Garcia
    Replies:
    3
    Views:
    231
    vincent
    Apr 13, 2006
Loading...

Share This Page