Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. protected void Page_Load(object sender, EventArgs e)
  2. {
  3. if (!IsPostBack)
  4. {
  5. con = new SqlConnection(conString);
  6. string sqlstring = string.Empty;
  7. if (Request.QueryString["Id"] != null)
  8. {
  9. btnSave.Visible = false;
  10. btnUpdate.Visible = true;
  11. String Wherecluase =Request.QueryString["Id"].ToString();
  12. if (Wherecluase == "" || Wherecluase == string.Empty)
  13. {
  14. sqlstring = "select Id,EmployeeName,MobileNumber,CONVERT(varchar(10),DOB,103) as DOB,[Status] from EmployeeList ";
  15. }
  16. else
  17. {
  18. sqlstring = "select Id,EmployeeName,MobileNumber,EmailID,CONVERT(varchar(10),DOB,103) as DOB,[Status] from EmployeeList where id = " + Wherecluase ;
  19. }
  20. SqlCommand cmd = new SqlCommand(sqlstring, con);
  21. con.Open();
  22. SqlDataReader r = cmd.ExecuteReader();
  23. while (r.Read())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement