using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

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

        private void button1_Click(object sender, EventArgs e)
        {
            string sqlString;
            sqlString = "select * from Students";
            SqlDataAdapter da = new SqlDataAdapter(sqlString, userControl11.connect);
            DataSet ds = new DataSet();
            da.Fill(ds, "Students");
            dataGridView1.DataBindings.Add(new Binding("DataSource", ds, "Students"));
        }

        private void userControl11_Load(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }
    }
}
