Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.58 KB | None | 0 0
  1.  try
  2.     {
  3.         myconnection.OPEN();
  4.         cmd = NEW SqlCommand("select count(*) from Avtori  where Username=@emp_ID and Password=@password", myconnection);
  5.         cmd.Parameters.AddWithValue("@emp_ID",usernameTXTBOX);
  6.         cmd.Parameters.AddWithValue("@password",passwordTXTBOX);
  7.        
  8.  
  9.         INT COUNT = CONVERT.ToInt32(cmd.ExecuteScalar());            
  10.         IF (COUNT == 1 )
  11.         {
  12.             MessageBox.SHOW("Access Granted");
  13.         }
  14.         ELSE
  15.         {
  16.             MessageBox.SHOW("Access denied");
  17.         }
  18.         myconnection.Close();
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement