none
Returning Index name, Return Dataset object current index RRS feed

  • Question

  • In c sharp How to Set or return the name of the current index for a dataset object. Can someone post and example or lead me to  the right place?
    Tuesday, October 14, 2014 3:21 PM

Answers

  • Hello pianoboyCoder,

    >>In c sharp How to Set or return the name of the current index for a dataset object.

    I do not quite understand what you are asking because as far as I know, the DataSet object does not have an index concept.

    Or if you mean you want to access rows in DataSet/DataTable by the CurrentRow (data cursor) concept for connected data sources (VB6 ActiveX ADO.)  in ADO.NET, then you could create a wrapper class for the DataTable and add an iCurrentRow property. As you "navigate" thru the rows, you would need to update this member variable (in MoveFirst. MoveLast, MoveNext and MovePrev methods you provide in this wrapper class.)

    Or use the For Each...Next Microsoft Visual Basic .NET statement or the foreach Microsoft Visual C# .NET statement to enumerate the rows as described in this KB article and this way is easier:

    https://support.microsoft.com/kb/310372?wa=wsignin1.0

    Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 15, 2014 7:47 AM
    Moderator