Copying one DS to another…!

Hi All, This is the code to manually copy one DS to other DS…..

Dim objds As New DataSet

Dim dr As DataRow

Dim drTemp As DataRow

Dim datatbl As New DataTable

Dim dc As DataColumn


Dim newdc As DataColumn

For Each dc In ds.Tables(0).Columns

newdc = New DataColumn(dc.ColumnName.ToString)



Dim I As Integer = 0

For Each dr In ds.Tables(0).Rows

drTemp = datatbl.NewRow()

drTemp.Item(0) = dr.Item(0)

drTemp.Item(1) = dr.Item(1)

drTemp.Item(2) = dr.Item(2)

drTemp.Item(3) = dr.Item(3)

drTemp.Item(4) = dr.Item(4)



DataGridView2.DataSource = objds.Tables(0).DefaultView

End Sub

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: