none
Different DataBase Connection RRS feed

  • Question

  • Hi
    How can I fetch data from two different databases Connect to the initial database Oracle 10G and
    The second database SQL Server and display them in two data grid view  using one class in c# code?

    Best regards.

    Sunday, November 4, 2018 8:01 PM

All replies

  • Use 2 different ADO.NET connections to read each set of data. Then merge them into a single DataSet. You can then render that in DGV. If you need to save data back then you'll need to track which tables/rows came from which databases.

    Michael Taylor http://www.michaeltaylorp3.net

    Sunday, November 4, 2018 8:04 PM
    Moderator
  • You will have two database connections. You will have two datatables one for each database with both databases having the same column names.

    Then you merge the two datatables to produce one datatable that has all the data in one table.

    https://www.c-sharpcorner.com/UploadFile/b182bf/how-to-add-two-datatable-in-single-datatable-in-C-Sharp/

    Sunday, November 4, 2018 8:20 PM