Is FindBy<Key> Method applicable to design time dataset

Discussion in 'ASP .Net' started by Keith, Feb 7, 2004.

  1. Keith

    Keith Guest

    Hi,

    I created a dataset during run time and assigned it to the datagrid.
    But i cant get the FindBy<Key> method to work. During design time, i
    got a error "dtProdHdr is not a member of System.Data.DataSet" error

    Is it that FindBy<Key> method is used only for DataSet generated
    during design time by the wizard? Can i actually use FindBy<Key>
    method if i am using a design time created dataset?

    below is a sample of my codes

    Shared dsProdInfo As DataSet
    Shared dtProdHdr As DataTable
    Shared dtProdDtl As DataTable

    Dim myDataRow As DataRow

    Sub myFunction()
    dsProdInfo.DataSetName = "dsProdInfo"

    dtProdHdr = New DataTable("dtProdHdr")
    dtProdHdr.Columns.Add("PROD_CAT")
    dtProdHdr.Columns.Add("PROD_TYPE")
    dtProdHdr.Columns.Add("KIT_NO")
    dtProdHdr.Columns.Add("PROD_DESC")

    dsProdInfo.Tables.Add(dtProdHdr)

    Dim dr as DataRow

    ' Error "dtProdHdr is not a member of System.Data.DataSet" occurs
    below
    dr = dsProdInfo.dtProdHdr.FindByPROD_DET_ID()

    End Sub


    Thanks for any advice

    Keith
    Keith, Feb 7, 2004
    #1
    1. Advertising

  2. Keith

    Keith Guest

    Hi,

    Forgot to mentioned that i did set the datakey of my DataGrid1 to PROD_DET_ID

    and also ...

    dr = dsProdInfo.dtProdHdr.FindByPROD_DET_ID()

    shd be as

    dr = dsProdInfo.dtProdHdr.FindByPROD_DET_ID(key)


    any one has any idea what i missed out?

    (Keith) wrote in message news:<>...
    > Hi,
    >
    > I created a dataset during run time and assigned it to the datagrid.
    > But i cant get the FindBy<Key> method to work. During design time, i
    > got a error "dtProdHdr is not a member of System.Data.DataSet" error
    >
    > Is it that FindBy<Key> method is used only for DataSet generated
    > during design time by the wizard? Can i actually use FindBy<Key>
    > method if i am using a design time created dataset?
    >
    > below is a sample of my codes
    >
    > Shared dsProdInfo As DataSet
    > Shared dtProdHdr As DataTable
    > Shared dtProdDtl As DataTable
    >
    > Dim myDataRow As DataRow
    >
    > Sub myFunction()
    > dsProdInfo.DataSetName = "dsProdInfo"
    >
    > dtProdHdr = New DataTable("dtProdHdr")
    > dtProdHdr.Columns.Add("PROD_CAT")
    > dtProdHdr.Columns.Add("PROD_TYPE")
    > dtProdHdr.Columns.Add("KIT_NO")
    > dtProdHdr.Columns.Add("PROD_DESC")
    >
    > dsProdInfo.Tables.Add(dtProdHdr)
    >
    > Dim dr as DataRow
    >
    > ' Error "dtProdHdr is not a member of System.Data.DataSet" occurs
    > below
    > dr = dsProdInfo.dtProdHdr.FindByPROD_DET_ID()
    >
    > End Sub
    >
    >
    > Thanks for any advice
    >
    > Keith
    Keith, Feb 8, 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. Henry

    FindBy<> method in Typed DataSet.

    Henry, Dec 19, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,440
    Henry
    Dec 19, 2003
  2. Greg McAllister

    Using the FindBy method

    Greg McAllister, Jun 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    650
    Greg McAllister
    Jun 9, 2005
  3. Kiran

    ### FindBy in Typed Dataset ###

    Kiran, Jul 14, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    539
    Robert Smith
    Jul 16, 2005
  4. Tristan
    Replies:
    1
    Views:
    401
    Hugo Pragt
    Jan 26, 2004
  5. ankur
    Replies:
    1
    Views:
    12,705
    Jan =?UTF-8?B?VGhvbcOk?=
    Aug 27, 2007
Loading...

Share This Page