string constring = "Data Source=localhost\\SQLEXPRESS;Initial Catalog=bar_db;Integrated Security=True";
SqlConnection con = new SqlConnection(constring);
DateTime dt = new DateTime();
dt = Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString());
SqlCommand cmd = new SqlCommand();
string sqlqry = "select mbrchrg AS MemberCharge,costumechrg AS CostumerCharge,Date from swimpool where Date = '" + dt + "'";
dataGridView1.DataSource = "";
cmd.CommandText = sqlqry;
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "swimpool");
dataGridView1.DataSource = ds.Tables["swimpool"].DefaultView;
-------------------------------------------------------------------------
namespace HotelManagement
{
public partial class User_Record : Form
{
Dbclass db = new Dbclass();
string common;
public User_Record()
{
InitializeComponent();
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void User_Record_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
string str = "select Addmminisator,User_Id,User_Type,User_Name,User_Password from user_master";
dt = db.FindFun(str);
grduser_record.DataSource = dt;
totalrecord.Text = Convert.ToInt32(grduser_record.Rows.Count - 1).ToString();
}
private void btnpreview_Click(object sender, EventArgs e)
{
Crstluser_master use = new Crstluser_master();
Frmviewr view = new Frmviewr();
DataTable dt = new DataTable();
string str = " Select * from user_Master";
dt = db.FindFun(str);
use.SetDataSource(dt);
view.crstlviewer.ReportSource = use;
view.Show();
}
}
}
SqlConnection con = new SqlConnection(constring);
DateTime dt = new DateTime();
dt = Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString());
SqlCommand cmd = new SqlCommand();
string sqlqry = "select mbrchrg AS MemberCharge,costumechrg AS CostumerCharge,Date from swimpool where Date = '" + dt + "'";
dataGridView1.DataSource = "";
cmd.CommandText = sqlqry;
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "swimpool");
dataGridView1.DataSource = ds.Tables["swimpool"].DefaultView;
-------------------------------------------------------------------------
namespace HotelManagement
{
public partial class User_Record : Form
{
Dbclass db = new Dbclass();
string common;
public User_Record()
{
InitializeComponent();
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void User_Record_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
string str = "select Addmminisator,User_Id,User_Type,User_Name,User_Password from user_master";
dt = db.FindFun(str);
grduser_record.DataSource = dt;
totalrecord.Text = Convert.ToInt32(grduser_record.Rows.Count - 1).ToString();
}
private void btnpreview_Click(object sender, EventArgs e)
{
Crstluser_master use = new Crstluser_master();
Frmviewr view = new Frmviewr();
DataTable dt = new DataTable();
string str = " Select * from user_Master";
dt = db.FindFun(str);
use.SetDataSource(dt);
view.crstlviewer.ReportSource = use;
view.Show();
}
}
}
No comments:
Post a Comment