Given enough time and enough monkeys....
I found that I have to re-"Fill" the dataset/datatable to get the find to
work. It seems that even if you declare the datatable at the module level,
it looses it's contents after being bound to the datagrid?!
[quoted text, click to view] "Perry Ogletree comcast.net>" <pogletree<at> wrote in message
news:uk$BQAYKEHA.644@tk2msftngp13.phx.gbl...
> I'm trying to use the datatable find method to retrieve information from
an
> Access database. I retrieve the Access data into a dataset using:
> daStationData.Fill(dsStationData,"dtblStationData")
> The data is then displayed in a sorted datagrid via:
> dgDisplay.SetDataBinding(dsStationData, "dtblStationData")
> In another part of the application, I want to allow the user to enter a
> station id and retrieve that station's data by using:
> Dim foundRow As DataRow
> foundRow = dtblStationData.Rows.Find(sCall) 'where sCall is a string
> This fails (returns Nothing) when the database has data in it from an
"old"
> session, i.e. the app was run and data was entered in the empty
> database,saved and the app exited. If I try the Find with a fresh
database
> with new entries, the Find works. I have verified that the datatable's
> primary key is correct and can not figure out why it won't work all the
> time!
> Any ideas???
>
> Thanks,
> Perry
>
>