Advertisement
Guest User

Untitled

a guest
May 28th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. SqlConnection c;
  2.  
  3. string str = "Data Source =(LocalDB)\MSSQLLocalDB;";
  4. str += "AttachDbFilename=|DataDirectory|\DinoData.mdf;";
  5. str += "Integrated Security= True";
  6.  
  7. c = new SqlConnection(str);
  8.  
  9. if (Session["Connect"] != null)
  10. {
  11. if ((bool)Session["Connect"])
  12. {
  13. logdiv.Visible = false;
  14. Usernamec.InnerHtml = (string)Session["CurentUserid"];
  15. Connected.Visible = true;
  16.  
  17. SqlCommand exp = new SqlCommand("SELECT xp FROM[User] Where Username = @username", c);
  18. exp.Parameters.AddWithValue("@username", (string)Session["CurentUserid"]);
  19.  
  20. c.Open();
  21. Session["exp"] = exp.ExecuteReader();
  22. c.Close();
  23.  
  24. int b = (int)Session["exp"] / 2;
  25. string a = b + "px";
  26. xp.Style.Add("width", ((string)Session["exp"])+"%");
  27. }
  28. else
  29. {
  30. Connected.Visible = false;
  31. logdiv.Visible = true;
  32. }
  33. }
  34.  
  35. SqlConnection c;
  36. string str = "Data Source =(LocalDB)\MSSQLLocalDB;";
  37. str += "AttachDbFilename=|DataDirectory|\DinoData.mdf;";
  38. str += "Integrated Security= True";
  39. c = new SqlConnection(str);
  40. if (Session["Conect"] != null)
  41. {
  42. if ((bool)Session["Conect"])
  43. {
  44. logdiv.Visible = false;
  45. Usernamec.InnerHtml = (string)Session["CurentUserid"];
  46. Connected.Visible = true;
  47. SqlCommand exp = new SqlCommand("SELECT xp FROM[User] Where Username = @username", c);
  48. exp.Parameters.AddWithValue("@username", (string)Session["CurentUserid"]);
  49. c.Open();
  50. Session["exp"] = exp.ExecuteScalar();
  51. c.Close();
  52. int b = (int)Session["exp"] / 2;
  53. string a = b + "%";
  54. xp.Style.Add("width", a);
  55. }
  56. else
  57. {
  58. Connected.Visible = false;
  59. logdiv.Visible = true;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement