Guest User

Untitled

a guest
Sep 11th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. Type or namespace definition, or end-of-file expected [closed]
  2. public partial class SeenSMS : System.Web.UI.UserControl
  3. {
  4. //temp sql connection
  5. //public SqlConnection mycon;
  6. SqlConnection mycon = new SqlConnection(@"Data Source=ASOFT20MAMUT;Initial Catalog=ViltraNew;UserID=sa;Password=sa123");
  7.  
  8.  
  9. protected void Page_Load(object sender, EventArgs e)
  10. {
  11. string[] msg_arr = Request.QueryString["arr"].Split('|');
  12.  
  13. if (!IsPostBack)
  14. {
  15. string Moose = Request.QueryString[1];
  16. }
  17.  
  18. if (msg_arr != null)
  19. {
  20. if ((msg_arr.Length == 3) && (msg_arr[1].ToLower() == "slett"))
  21.  
  22. {
  23. int Hours = Convert.ToInt32(msg_arr[2]);
  24.  
  25. if (Hours > 0)
  26. {
  27. string username = msg_arr[0];
  28.  
  29. SqlCommand com = new SqlCommand("SELECT count(*) as count FROM Animal Where Hours=@Hours", mycon);
  30. com.Parameters.AddWithValue("@Hours",Hours);
  31. using (SqlDataReader reader = com.ExecuteReader())
  32. {
  33. if(reader.HasRows)
  34. {
  35. while (reader.Read())
  36. {
  37. // int number = Convert.ToInt32(con.ExecuteReader());
  38. int number = Convert.ToInt32(reader["count"]);
  39.  
  40. }
  41. }
  42. else{
  43.  
  44. }
  45. }
  46. }
  47. // if( number == 0)
  48. // {
  49. // Response.Write("Improper Plain Summaries.");
  50. // }
  51. // else
  52. {
  53.  
  54. }
  55.  
  56.  
  57. }
  58. }
  59.  
  60.  
  61. }
  62.  
  63. public bool number { get; set; }
  64. public object Hours { get; set; }}
  65.  
  66.  
  67.  
  68. // public System.Collections.Specialized.NameValueCollection Moose { get; set; }
  69.  
  70.  
  71.  
  72. // public string Value { get; set; }
  73.  
  74. // public object msg_arr { get; set; }
  75. }
  76. }
  77.  
  78. public object Hours { get; set; }}
  79.  
  80. public object Hours { get; set; }}
Add Comment
Please, Sign In to add comment