public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(objectsender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=Mreport;Integrated Security=True;");
con.Open();
SqlCommand sql = new SqlCommand("SELECT * FROM Transactions", con);
SqlDataAdapter objDA = new SqlDataAdapter(sql);
DataSet dsEmployee = new DataSet();
objDA.Fill(dsEmployee, "dtEmployee");
dataGridView1.DataSource = dsEmployee.Tables["dtEmployee"];
conn.Close();
}
}
}