Q: Equivalent code in VB?

A

Arne Janning

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
 
G

Geoff Jones

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top