retrieve a record from a dataset?????

Discussion in 'ASP .Net' started by DaveF, Jul 29, 2004.

  1. DaveF

    DaveF Guest

    How can I retrieve display_names





    Dim custDS As DataSet = New DataSet

    Dim mySQL, mySQL2, mySQL3 As String

    mySQL = "SELECT id,GBL_NO,TCN,TRAC_NO,SHIP_NAME, CAT FROM(SELECT
    id,GBL_NO,TCN,TRAC_NO,CAT,SHIP_NAME, ROW_NUMBER() OVER ( PARTITION BY TCN
    ORDER BY TCN, TRAC_NO, CAT ) as row_num FROM TRACK.DTTS WHERE (CDATE BETWEEN
    TO_DATE('7/18/2003','MM/DD/YYYY') AND TO_DATE('7/20/2004','MM/DD/YYYY')) AND
    ((gbl_no= qqqqqqqqqq)) ) WHERE row_num = 1 ORDER BY TCN"

    ' mySQL = "SELECT id,GBL_NO,TCN,TRAC_NO, CAT FROM(SELECT
    id,GBL_NO,TCN,TRAC_NO,CAT, ROW_NUMBER() OVER ( PARTITION BY GBL_NO ORDER BY
    GBL_NO, TCN, TRAC_NO, CAT ) as row_num FROM TRACK.V_LATESTPNTDTTS WHERE
    (CDATE BETWEEN TO_DATE('7/18/2003','MM/DD/YYYY') AND
    TO_DATE('7/20/2004','MM/DD/YYYY')) AND ((SCACNAME LIKE 'T%')) or ((SCACNAME
    LIKE 'p%'))) WHERE row_num = 1 ORDER BY GBL_NO"

    mySQL2 = "SELECT TCN,CDATE FROM TRACK.DTTS WHERE (CDATE BETWEEN
    TO_DATE('7/18/2003','MM/DD/YYYY') AND TO_DATE('7/20/2004','MM/DD/YYYY')) AND
    ((gbl_no= 'A-1003601-01')) ORDER BY tcn,id"

    mySQL3 = "SELECT display_names FROM TRACK.V_RPTTRACK WHERE ID = 6"

    Dim myTable As DataTable

    myTable = myData.GetTableData(mySQL)

    custDS.Tables.Add(myTable)

    custDS.Tables(0).TableName = "Table1"

    myTable = myData.GetTableData(mySQL2)

    custDS.Tables.Add(myTable)

    custDS.Tables(1).TableName = "Table2"

    myTable = myData.GetTableData(mySQL3)

    custDS.Tables.Add(myTable)

    custDS.Tables(2).TableName = "Table3"

    ***************************************************** How can I retrieve
    display_names ******************************

    'custDS = myData.GetData(mySQL)

    'custDS1 = myData.GetData(mySQL2)

    custDS.Relations.Add("table2", custDS.Tables("Table1").Columns("TCN"),
    custDS.Tables("Table2").Columns("TCN"), False)

    custDS.Relations("Table2").Nested = True

    custDS.WriteXml(Server.MapPath("Relate.xml"), XmlWriteMode.WriteSchema)

    If (custDS.Relations.Count < 1) Then
    custDS.Relations.Add(custDS.Tables("Table1").Columns("TCN"),
    custDS.Tables("Table2").Columns("TCN"))

    Me.grdtest.DataSource = custDS ' = custDS.Tables("Table1").DefaultView

    'grdtest.

    grdtest.Visible = True

    Me.DataBind()


    --


    David Fetrow
    Helixpoint LLC.
    http://www.helixpoint.com
    DaveF, Jul 29, 2004
    #1
    1. Advertising

  2. the dataset can be addressed like a matrix
    ds.tables[0].rows[row][col].tostring() so you can use row,col co-ordinates
    to find your item

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "DaveF" <> wrote in message
    news:...
    > How can I retrieve display_names
    >
    >
    >
    >
    >
    > Dim custDS As DataSet = New DataSet
    >
    > Dim mySQL, mySQL2, mySQL3 As String
    >
    > mySQL = "SELECT id,GBL_NO,TCN,TRAC_NO,SHIP_NAME, CAT FROM(SELECT
    > id,GBL_NO,TCN,TRAC_NO,CAT,SHIP_NAME, ROW_NUMBER() OVER ( PARTITION BY TCN
    > ORDER BY TCN, TRAC_NO, CAT ) as row_num FROM TRACK.DTTS WHERE (CDATE
    > BETWEEN
    > TO_DATE('7/18/2003','MM/DD/YYYY') AND TO_DATE('7/20/2004','MM/DD/YYYY'))
    > AND
    > ((gbl_no= qqqqqqqqqq)) ) WHERE row_num = 1 ORDER BY TCN"
    >
    > ' mySQL = "SELECT id,GBL_NO,TCN,TRAC_NO, CAT FROM(SELECT
    > id,GBL_NO,TCN,TRAC_NO,CAT, ROW_NUMBER() OVER ( PARTITION BY GBL_NO ORDER
    > BY
    > GBL_NO, TCN, TRAC_NO, CAT ) as row_num FROM TRACK.V_LATESTPNTDTTS WHERE
    > (CDATE BETWEEN TO_DATE('7/18/2003','MM/DD/YYYY') AND
    > TO_DATE('7/20/2004','MM/DD/YYYY')) AND ((SCACNAME LIKE 'T%')) or
    > ((SCACNAME
    > LIKE 'p%'))) WHERE row_num = 1 ORDER BY GBL_NO"
    >
    > mySQL2 = "SELECT TCN,CDATE FROM TRACK.DTTS WHERE (CDATE BETWEEN
    > TO_DATE('7/18/2003','MM/DD/YYYY') AND TO_DATE('7/20/2004','MM/DD/YYYY'))
    > AND
    > ((gbl_no= 'A-1003601-01')) ORDER BY tcn,id"
    >
    > mySQL3 = "SELECT display_names FROM TRACK.V_RPTTRACK WHERE ID = 6"
    >
    > Dim myTable As DataTable
    >
    > myTable = myData.GetTableData(mySQL)
    >
    > custDS.Tables.Add(myTable)
    >
    > custDS.Tables(0).TableName = "Table1"
    >
    > myTable = myData.GetTableData(mySQL2)
    >
    > custDS.Tables.Add(myTable)
    >
    > custDS.Tables(1).TableName = "Table2"
    >
    > myTable = myData.GetTableData(mySQL3)
    >
    > custDS.Tables.Add(myTable)
    >
    > custDS.Tables(2).TableName = "Table3"
    >
    > ***************************************************** How can I retrieve
    > display_names ******************************
    >
    > 'custDS = myData.GetData(mySQL)
    >
    > 'custDS1 = myData.GetData(mySQL2)
    >
    > custDS.Relations.Add("table2", custDS.Tables("Table1").Columns("TCN"),
    > custDS.Tables("Table2").Columns("TCN"), False)
    >
    > custDS.Relations("Table2").Nested = True
    >
    > custDS.WriteXml(Server.MapPath("Relate.xml"), XmlWriteMode.WriteSchema)
    >
    > If (custDS.Relations.Count < 1) Then
    > custDS.Relations.Add(custDS.Tables("Table1").Columns("TCN"),
    > custDS.Tables("Table2").Columns("TCN"))
    >
    > Me.grdtest.DataSource = custDS ' = custDS.Tables("Table1").DefaultView
    >
    > 'grdtest.
    >
    > grdtest.Visible = True
    >
    > Me.DataBind()
    >
    >
    > --
    >
    >
    > David Fetrow
    > Helixpoint LLC.
    > http://www.helixpoint.com
    >
    >
    >
    Alvin Bruney [MVP], Jul 31, 2004
    #2
    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. nicholas
    Replies:
    4
    Views:
    11,296
  2. loreille
    Replies:
    1
    Views:
    4,468
    Ben Strackany
    Oct 28, 2004
  3. loreille
    Replies:
    0
    Views:
    452
    loreille
    Oct 28, 2004
  4. Retrieve Record Count

    , Oct 17, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    802
  5. Tony WONG
    Replies:
    1
    Views:
    327
    Joe Fawcett
    Oct 31, 2008
Loading...

Share This Page