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

namespace WindowsApplication1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void BindReport()
        {
            string connstring ="Server=(local);DataBase=pubs;UID=sa;PWD=";
            CrystalReport2 oCR = new CrystalReport2();
            SqlConnection MyConn = new SqlConnection(connstring);
            MyConn.Open();
            string strSel = "Select * from employee";
            SqlDataAdapter MyAdapter = new SqlDataAdapter(strSel, MyConn);
            //MyAdapter.Fill(dataSet11, "employee");
            //oCR.SetDataSource(dataSet11);
            this.crystalReportViewer1.ReportSource = oCR;
        }


        private void Form2_Load(object sender, EventArgs e)
        {
            BindReport();
        }
    }
}