Tuesday, May 27, 2014

how to Merge two datasets in asp.net

we can merge two datasets using the following code

VB.Net Code

Dim ds1 As New DataSet
Dim ds2 As New DataSet

If ds1 .Tables(0).Rows.Count > 0 Or ds2.Tables(0).Rows.Count > 0 Then
ds1.Tables(0).Merge(ds2.Tables(0), True, MissingSchemaAction.Ignore)
                gvResults.DataSource = ds1
                gvResults.DataBind()
End If

No comments:

Post a Comment