Solved

ASP.net merge two datasets

Posted on 2014-02-18
2
271 Views
Last Modified: 2014-02-24
Hi

What is the easiest way to merge two datasets that have the same first two columns, and that are created using code like the following


    Function GetData(ByVal queryString As String) As DataSet

        Dim cs As String = ConfigurationManager.ConnectionStrings("survey_conn").ConnectionString
        Dim myConnection As SqlConnection = New SqlConnection(cs)

        Dim ds As New DataSet()

        Try

            ' Connect to the database and run the query.

            Dim adapter As New SqlDataAdapter(queryString, myConnection)
            ' Fill the DataSet.
            Adapter.Fill(ds)


        Catch ex As Exception

            ' The connection failed. Display an error message.
            Me.Label_Error1.Text = "Unable to connect to the database." & Err.Description

        End Try

        Return ds

    End Function
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 39871383
Easiest way should be DataSet.Merge.

DataSet.Merge Method
http://msdn.microsoft.com/en-us/library/system.data.dataset.merge(v=vs.110).aspx
0
 

Author Closing Comment

by:Murray Brown
ID: 39882315
Thanks very much
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question