MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

ADO.NET

ADO.NET Projects

ADO.NET Project 1

ADO.NET Examples

Examples

Merge Table
Previous Home Next
  1. Different Table Structures,No Primary Key

    In the strongly typed DataSet, Table0 can be used as a sample table that has no primary keys defined on it.

  2. Binding the student datasource in table1 and table2
  3. write the code
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Data.OleDb;
    namespace WindowsFormsApplication13
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }
    private void Form1_Load(object sender, EventArgs e)
    {
    // TODO: This line of code loads data into 
    //the 'studentDataSet.student' table. 
    You can move, or remove it, as needed.
    this.studentTableAdapter.Fill(this.studentDataSet.student);
    // TODO: This line of code loads data into 
    //the 'studentDataSet.std1' table. 
    You can move, or remove it, as needed.
    this.std1TableAdapter.Fill(this.studentDataSet.std1);   
    }
    private void button1_Click(object sender, EventArgs e)
    {
    OleDbConnection con = new OleDbConnection
    ("Provider=Microsoft.Jet.OLEDB.4.0;
    Data Source=F:\\student.mdb");
    OleDbDataAdapter ad = new OleDbDataAdapter("select * from std1", con);
    DataTable tb1 = new DataTable();
    ad.Fill(tb1);
    dataGridView4.Visible = true;
    dataGridView4.DataSource = tb1;
    OleDbDataAdapter ad1 = new OleDbDataAdapter
    ("select * from student", con);
    DataTable tb2 = new DataTable();
    ad1.Fill(tb2);
    tb1.Merge(tb2);
    dataGridView3.DataSource = tb1;
    dataGridView3.Visible = true;
    dataGridView1.Visible = false;
    label1.Visible = false;
    label2.Visible = false; 
    }
    }
    }
    
  4.  

  5. Run thr program
  6. click the merge button
Previous Home Next