Is FindBy<Key> Method applicable to design time dataset

K

Keith

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
 
K

Keith

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top