0

Im just getting started with dotnet. So I decided to take up a project, which is about 2 different websites to control one from another. The remote website and the display website. I took the approach involving a database, so like the remote website updates the database "Is_Clicked" "Option_1"... Used this type of modules to make changes in database.

protected void Is_Clicked_1(object sender, EventArgs e)
    {

        SqlConnection conn = new SqlConnection(@"*CONNECTIONSTRING*");


        SqlCommand command = new SqlCommand("INSERT INTO Is_Clicked (IS_CLICKED) VALUES (1)", conn);
        conn.Open();
        int rowsAffected = command.ExecuteNonQuery();
        conn.Close();

        if (rowsAffected == 1)
        {
            Response.Redirect("Option1.aspx");
        }
        else
        {
            string message = "Error";
            string title = "Error";
            MessageBox.Show(message, title);
        }
    }

So Basically this works in updating a dtabase, Now I'm in a rut about how to c# code the display page to instantaneously detect changes in database in an asp website. the rest i can work with. Please just help me out with that part of the code, internet. I cant sleep if I don't crack this.

0 Answers0