SqlCommand cmd = new SqlCommand("select * from emp_sal where emp_id="+TextBox17.Text, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count == 0)
{
Label18.Text = "Record Not found";
}
else
{
TextBox1.Text = ds.Tables[0].Rows[0]["emp_id"].ToString();
TextBox2.Text = ds.Tables[0].Rows[0]["basic_salary"].ToString();
TextBox3.Text = ds.Tables[0].Rows[0]["hra"].ToString();
TextBox4.Text = ds.Tables[0].Rows[0]["da"].ToString();
TextBox5.Text = ds.Tables[0].Rows[0]["ta"].ToString();
TextBox6.Text = ds.Tables[0].Rows[0]["emp_grade"].ToString();
TextBox7.Text = ds.Tables[0].Rows[0]["pf_reduction"].ToString();
TextBox8.Text = ds.Tables[0].Rows[0]["pf_amount"].ToString();
TextBox9.Text = ds.Tables[0].Rows[0]["pension_benifits"].ToString();
TextBox11.Text = ds.Tables[0].Rows[0]["medical_benifits"].ToString();
TextBox12.Text = ds.Tables[0].Rows[0]["total_salary"].ToString();
}
No comments:
Post a Comment