using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace _0_1
{
  public partial class Form1 : Form
  {
    public Form1()
    {
       InitializeComponent();
    }
    private void Display_Click(object sender, EventArgs e)
    {
       string strSql;
       string strCon;
       strCon = "Data Source=RAYANEH-C5E4683\\SQLEXPRESS;Initial Catalog=Student1;Integrated Security=True";
       SqlConnection  con = new SqlConnection(strCon);
       con.Open();
       strSql = "SELECT * FROM stTable";
       SqlDataAdapter da = new SqlDataAdapter(strSql, con);
       DataSet ds = new DataSet();
       da.Fill(ds, "stTable");
       DataGrid1.DataBindings.Add(new Binding("DataSource", ds, "stTable"));
       con.Close();
    }
    private void Exit_Click(object sender, EventArgs e)
    {
       Close();
    }
  }
}
