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.SqlClient;

namespace Emdad
{
    public partial class ReportEmdad : Form
    {
        SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=emdad;Integrated Security=True");
        SqlCommand cmd = new SqlCommand();
        DataSet1 ds = new DataSet1();
        public ReportEmdad()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ds.Clear();
            cmd.Connection = con;
            con.Open();
            cmd.CommandText = "select * from Emdad";
            cmd.ExecuteNonQuery();
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = cmd;
            da.Fill(ds, "t1");
            con.Close();
            CrystalReport11.SetDataSource(ds.Tables["t1"]);
            crystalReportViewer1.ReportSource = CrystalReport11;
        }
    }
}
