DataSet and DataAdapter in C#

By
Hi Friends! here i am going to show you "how can Make the Dataset and Data-Adapter using coding" in disconnected architecture. There are some steps please follow one by one which are given below.
Step1:-  First open your visual studio-> File-> New project -> select windows form application->click OK.-> Drag and Drop Data grid-view control  and one Button control from the Toolbox.
See it:-

Step2:-  Double click  on Button and write the following code.
using System;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data;

namespace ado
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("data source=RAMASHANKER-PC;integrated security=yes; database=master");
            SqlDataAdapter da = new SqlDataAdapter("select*from student", con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            dataGridView1.DataSource = ds.Tables[0];
          
        }
    }
}

SEE IT:-


Step3:- Run the application(press F5).
OUTPUT:--
For more:-

  1. Dataset  and Data Adapter Without coding
  2. Data integrity
  3. Overview of C#
  4. Setup file
  5. Interview Questions and Answers

I hope this is helpful for you.
To Get the Latest  Free Updates Subscribe
Click below for  download the whole application.
          DOWNLOAD

0 comments:

Post a Comment

Powered by Blogger.