wsyeager
Well-known member
Does anybody know how you can merge data from an Untyped Dataset into a specific table of a Strongly Typed Dataset?
Check out the following function:
<code>
Public Function GetCustomerss() As dstCustomers
Try
Dim dst As New DataSet
Dim tablenames() As String = {"Customers"}
SqlHelper.FillDataset(SqlDataAdapter1.SelectCommand, dst, tablenames)
DstCustomers1.Merge(dst)
Catch ex As Exception
Throw (ex)
Finally
SqlDataAdapter1.Dispose()
SqlConnection1.Close()
End Try
Return DstCustomers1
End Function
</code>
Suppose that dataset "DstCustomers1" has two tables in it (Customers and Orders). When you perform the following code,
<code>
DstCustomers1.Merge(dst)
</code>
if DstCustomers1 has only one table, it will perform the merge with no problem. However, how can you specifically merge the contents of the Untyped dataset into a specific table of DstCustomers1 (like into the Customers or Orders table)?
Check out the following function:
<code>
Public Function GetCustomerss() As dstCustomers
Try
Dim dst As New DataSet
Dim tablenames() As String = {"Customers"}
SqlHelper.FillDataset(SqlDataAdapter1.SelectCommand, dst, tablenames)
DstCustomers1.Merge(dst)
Catch ex As Exception
Throw (ex)
Finally
SqlDataAdapter1.Dispose()
SqlConnection1.Close()
End Try
Return DstCustomers1
End Function
</code>
Suppose that dataset "DstCustomers1" has two tables in it (Customers and Orders). When you perform the following code,
<code>
DstCustomers1.Merge(dst)
</code>
if DstCustomers1 has only one table, it will perform the merge with no problem. However, how can you specifically merge the contents of the Untyped dataset into a specific table of DstCustomers1 (like into the Customers or Orders table)?