Q: Equivalent code in VB?

  • Thread starter Thread starter Geoff Jones
  • Start date Start date
Geoff said:
Can anybody tell me the equivalent code in VB for the following?

public static void copyADataRow(DataRow objSrcRow, DataRow objTargetRow)
{
int i=0;

for each(object item in objSrcRow.ItemArray)
{
objTargetRow[i++] = item;
}
return;
}

As a matter of interest, the code above is taken from
http://www.dotnetspider.com/Technology/KBPages/139.aspx

Public Shared Sub copyADataRow( _
ByVal objSrcRow as DataRow, _
ByVal objTargetRow as DataRow)
Dim i as Integer = 0
For Each item as Object in objSrcRow.ItemArray
objTargetRow(i += 1) = item
Next
End Sub

I think, that's it.

Cheers

Arne Janning
 
Arne Janning said:
Geoff said:
Can anybody tell me the equivalent code in VB for the following?

public static void copyADataRow(DataRow objSrcRow, DataRow objTargetRow)
{
int i=0;

for each(object item in objSrcRow.ItemArray)
{
objTargetRow[i++] = item;
}
return;
}

As a matter of interest, the code above is taken from
http://www.dotnetspider.com/Technology/KBPages/139.aspx

Public Shared Sub copyADataRow( _
ByVal objSrcRow as DataRow, _
ByVal objTargetRow as DataRow)
Dim i as Integer = 0
For Each item as Object in objSrcRow.ItemArray
objTargetRow(i += 1) = item
Next
End Sub

I think, that's it.

Cheers

Arne Janning

Many thanks guys!
 
Back
Top