SHARE
TWEET

Untitled

a guest Jun 16th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string connectionString = ConfigurationManager.ConnectionStrings["payroll_conn"].ConnectionString;
  2.         using (SqlConnection sqlconn = new SqlConnection(connectionString))
  3.         {
  4.             sqlconn.Open();
  5.             using (SqlCommand com = new SqlCommand("SELECT * FROM employee WHERE fname=@fname and designation=@designation", sqlconn))
  6.             {
  7.                 com.Parameters.AddWithValue("@fname", en1.Text);
  8.                 com.Parameters.AddWithValue("@designation", e1.Text);
  9.  
  10.                 using (SqlDataAdapter sda = new SqlDataAdapter(com))
  11.                 {
  12.  
  13.                     ds1 = new DataSet();
  14.                     sda.Fill(ds1);
  15.                 }
  16.                 try
  17.                 {
  18.                     label39.Text = ds1.Tables[0].Rows[i]["id"].ToString();
  19.  
  20.                     dateTimePicker1.Text = ds1.Tables[0].Rows[i]["enddate"].ToString();
  21.  
  22.  
  23.                 }
  24.                 catch (Exception ex)
  25.                 {
  26.  
  27.                     Console.WriteLine(ex.Message);
  28.                 }
  29.             }
  30.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top