c# - Better way to iterate over strongly typed rows from DataView? -


Using Done 2.0 2.0 I currently have code like this:

  Dataview DV = new data view (dsTrans.Transactions, FilterSpec, sortSpec, DataViewRowState.CurrentRows); Foreign Currency (Dataraw VVR in DTR) {DeStressSection. Transenserso transcerov = (distrctionation transaction road) DVR.ro; // something with transor}  

Where "destrans" is a strongly typed dataset, I am thinking that there is a more type-safe approach to iterating the lines of dataview, in which Using an artist is not included (or using "as" keywords).

(Note that some ordering and filtering are required, which is why the dataview is used)

Thanks.

You can try:

  // only one cast Here the enumerator & lt; DSTransactions.TransactionsRow & gt; ENUMAR = (INIMM ENTER & LT; DESTRATIONSANS., TRANSESSEOVY & gt;) DVGETAnematator (); While (enumer.MoveNext ()) {// enumer.Current Type DSTransactions.TransactionsRow Console.WriteLine (enumer.Current) will be; } Enumer.Dispose ();  

Comments