I have a button on my asp.net webpage which I have coded to read the value of a boolean column in an access database on pageload and what the button does changes according to whether the value of the column is true or false. Essentially this button is a show/hide button for a product (click it to hide the product, or if already hidden click it to make it visible). I'm getting some strange behavior as when the product is hidden, clicking to make the product visible works (updates the database), however, hiding it does not and I can't work out why one would work but the other wouldn't. Thanks in advance for any suggestionsCode is as follows:\[code\] if (!IsPostBack) try { s = WebConfigurationManager.ConnectionStrings["LNDatabase"].ConnectionString; conn = new OleDbConnection(s); cmd = new OleDbCommand("SELECT * FROM products WHERE products.prod_id = @test", conn); OleDbParameter test = new OleDbParameter("@test", OleDbType.Integer); test.Value = http://stackoverflow.com/questions/14384861/Request.QueryString["prod_id"]; cmd.Parameters.Add(test); conn.Open(); dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); dr.Read(); title.Text = dr["shortdesc"].ToString(); description.Text = dr["longdesc"].ToString(); price.Text = dr["price"].ToString(); productcat = dr["cat"].ToString(); product_live = dr["live"].ToString(); } catch (Exception ex) { Response.Write(ex.Message.ToString()); } finally { dr.Close(); conn.Close(); }protected void Page_Load(object sender, EventArgs e)if (!IsPostBack) { bool prod_live_bool = Convert.ToBoolean(product_live); if (prod_live_bool == true) { live_label.Text = "This product is visible to customers"; livelabelbutton.Text = "Hide this product"; livelabelbutton.Click += new EventHandler(this.hideproduct_click); } else { live_label.Text = "This product is not visible to customers"; livelabelbutton.Text = "Make this product visible"; livelabelbutton.Click += new EventHandler(this.showproduct_click); } } protected void hideproduct_click(object sender, EventArgs e){ string prodid = Request.QueryString["prod_id"]; s = WebConfigurationManager.ConnectionStrings["LNDatabase"].ConnectionString; string str = "UPDATE products SET live = @hide WHERE prod_id=@product"; using (OleDbConnection conn = new OleDbConnection(s)) { using (OleDbCommand cmd = new OleDbCommand(str, conn)) { OleDbCommand mycommand = new OleDbCommand(); OleDbParameter hideparam = new OleDbParameter("@hide", OleDbType.Boolean); hideparam.Value = http://stackoverflow.com/questions/14384861/false; cmd.Parameters.Add(hideparam); OleDbParameter product = new OleDbParameter("@product", OleDbType.VarChar); product.Value = http://stackoverflow.com/questions/14384861/prodid; cmd.Parameters.Add(product); conn.Open(); cmd.ExecuteNonQuery(); } } Response.Redirect(Request.RawUrl);}protected void showproduct_click(object sender, EventArgs e){ string prodid = Request.QueryString["prod_id"]; s = WebConfigurationManager.ConnectionStrings["LNDatabase"].ConnectionString; string str = "UPDATE products SET live = @show WHERE prod_id=@product"; using (OleDbConnection conn = new OleDbConnection(s)) { using (OleDbCommand cmd = new OleDbCommand(str, conn)) { OleDbCommand mycommand = new OleDbCommand(); OleDbParameter hideparam = new OleDbParameter("@show", OleDbType.Boolean); hideparam.Value = http://stackoverflow.com/questions/14384861/true; cmd.Parameters.Add(hideparam); OleDbParameter product = new OleDbParameter("@product", OleDbType.VarChar); product.Value = http://stackoverflow.com/questions/14384861/prodid; cmd.Parameters.Add(product); conn.Open(); cmd.ExecuteNonQuery(); } } Response.Redirect(Request.RawUrl);}\[/code\]Sorry for the long code.