CurrentRecord

Waqas Khan

New member
Joined
Jul 26, 2005
Messages
4
Programming Experience
Beginner
I m using DataTable and want to get current record no. or if we want to work with current record.
 
Hi Waqas!!

It's not a problem if u r using DataTable or Data row or any other adapter method...

I m writing u down few code for finding the next record and current record..I hope it will help u...


For Next Record:-

Me.BindingContext(DataSet11, "TableName").Position = (Me.BindingContext(DataSet11, "TableName").Position + 1)
RecordLbl.Text = (((Me.BindingContext(DataSet11, "TableName").Position + 1).ToString + " Of ") & Me.BindingContext(DataSet11, "TableName").Count.ToString)

For Current Record:-

Me.BindingContext(DataSet11, "TableName").Position = (Me.BindingContext(DataSet11, "TableName").Position)
RecordLbl.Text = (((Me.BindingContext(DataSet11, "TableName").Position).ToString + " Of ") & Me.BindingContext(DataSet11, "TableName").Count.ToString)

Best Regards,

Have a nice day

Bye

 
If you are using vs.net 2005 beta version, and have a BindingSource in your form, you can do

Me.BindingSourceName.current

It returns an untyped object which refers to the current row.
 
Back
Top