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 ReportTakhasos : Form
    {
        SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=emdad;Integrated Security=True");
        SqlCommand cmd = new SqlCommand();
        DataSet2 ds = new DataSet2();
        public ReportTakhasos()
        {
            InitializeComponent();
        }

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