Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

insert button in c#

//For Login button
//                                             Database name                   username textbox
SqlDataAdapter sa = new SqlDataAdapter("select *from Login where UserName='" + UserName.Text + "' and Password='" + Password.Text + "'", con);
            DataTable dt = new DataTable();
            sa.Fill(dt);
            if (dt.Rows.Count == 1)
            {
                MessageBox.Show("Welcome");

                this.Hide();
                Main_Form fm = new Main_Form();
                fm.Show();
            }

            else if (dt.Rows.Count != 1)

            {
                MessageBox.Show("Wrong Data! Try Again");
            }
 
PREVIOUS NEXT
Tagged: #insert #button
ADD COMMENT
Topic
Name
5+9 =