Amy Turnbull

Amy Turnbull

  • NA
  • 40
  • 0

Button Event

Sep 17 2007 10:33 AM
Anyone tell me why after pressing the CheckOut button it dont go to the CheckIn button after, this is my code, any questions let me know

string myConnectionString = (string) ConfigurationSettings.AppSettings["ConnectionString"];   
   
// create connection
   
SqlConnection cnn = new SqlConnection(myConnectionString);
               
// create command

SqlCommand cmd = cnn.CreateCommand();
cmd.CommandType = CommandType.Text;

string CheckedOut = "0";

if (CheckedOut == "1")
{
cmd.CommandText = "select * from CheckedOut where CheckedOut = '1'";   
CheckOut.Visible = false;
CheckIn.Visible = true;
Console.WriteLine("Please check IN your IR");
}
else
{
cmd.CommandText = "select * from CheckedOut where CheckedOut = '0'";
CheckIn.Visible = false;
CheckOut.Visible = true;
Console.WriteLine("Check OUT IR first");
}
}

Answers (9)