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 LibraryMembers
{
    public partial class rptKarbaran : Form
    {
        public rptKarbaran()
        {
            InitializeComponent();
        }
        DataSet1 d1 = new DataSet1();

        private void rptKarbaran_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'DataSet1.MemberList1' table. You can move, or remove it, as needed.
            this.MemberList1TableAdapter.Fill(this.DataSet1.MemberList1);
            SqlConnection con = new SqlConnection();
            con.ConnectionString = Properties.Settings.Default.LibraryMembersConnectionString .ToString();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandText = @"SELECT     TOP 100 PERCENT dbo.Members.MemBerID, dbo.Members.Name , dbo.Members.Sname , dbo.Members.RegDate, 
                                                dbo.Members.ExprDate, dbo.Members.melliCode, dbo.MemberState.MemberState
                                                FROM         dbo.Members INNER JOIN
                                                                      dbo.MemberState ON dbo.Members.memberState = dbo.MemberState.StateID
                                                WHERE     (dbo.MemberState.StateID = 1)
                                                ORDER BY dbo.Members.MemBerID";
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            con.Open();
            da.Fill(d1, "MemberList1");
            con.Close();


            MemberList1BindingSource.DataSource = d1;
            this.reportViewer1.RefreshReport();
            reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
            reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
            reportViewer1.ZoomPercent = 25;
          
        }
    }
}