Click to See Complete Forum and Search --> : [2.0] dataset current record
arshesander
Oct 8th, 2007, 03:52 AM
how to get the dataset current row? this code doesnt work?
DataRow CurrentRow = dDataSet.Tables["tblPatient"].Position
jmcilhinney
Oct 8th, 2007, 03:57 AM
There's no such thing as a current record in a DataSet because DataSets don't have records. DataSets have DataTables. DataTables have records, but they still don't have current records. You can bind the same DataTable to multiple controls and each one could be displaying a different record. If it's not bound to any controls then the concept of a current record has no meaning whatsoever.
If you want to bind a DataTable to a control you should do so via a BindingSource. The BindingSource has two properties of interest that indicate the record currently selected in the bound control: Current (the record) and Position (the index of the record).
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.