Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
From DataViewRow to DataRow
Message
From
02/05/2017 15:08:52
 
 
To
All
General information
Forum:
VB.NET
Category:
Coding, syntax and commands
Title:
From DataViewRow to DataRow
Miscellaneous
Thread ID:
01650800
Message ID:
01650800
Views:
36
I have a method I am calling into which a property is set such as:
loClient.oRow = loRow
If Not loClient.DoSomething() Then
   Return False
End If
The class requires this to be a datarow.

However, in the client application that calls that method, I need to sort my data provider. So, I am using the dataview approach:
oData.oDataView.Sort = "AddDate"
The method will be called into a loop:
' For each record
For lnCounter = 0 To oData.nCount - 1
   loRow = oData.oRows(lnCounter)

   ' Get the list
   loClient.oRow = loRow
   If Not loClient.DoSomething() Then
      Return False
   End If

   ' Do something

Next
As that method was working looping against a data provider, making use of loRow, a datarow, everything was ok.

Now, I need to adjust to have this supporting the dataview:
' For each record
For Each loDataRowView In oData.oDataView

   ' Get the list
   loClient.oRow = loDataRowView
   If Not loClient.DoSomething() Then
      Return False
   End If

   ' Do something

Next
Then, of course, this would generate an error when assigning the value to loClient.oRow as a datarow object expect to receive a datarow object.

Assuming we would like to work around this without changing the class, what would be the best way to convert that loDataRowView into a datarow so it can then be passed as is to the class?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform