예제 #1
0
 protected void BtnAdd_Click(object sender, EventArgs e)
 {
     Database.Connection obj = new Database.Connection();
     if (txtName.Text.ToString().Equals("") && txtDetails.Text.ToString().Equals(""))
     {
         rslt.InnerHtml = "Fill all the Information ";
     }
     else
     {
         obj.cmdquery("insert into diet (Name,Description) values ('" + txtName.Text.ToString() + "','" + txtDetails.Text.ToString() + "')");
         rslt.InnerHtml  = "Record Saved";
         txtDetails.Text = "";
         txtName.Text    = "";
     }
 }
예제 #2
0
 protected void BtnAdd_Click(object sender, EventArgs e)
 {
     Database.Connection obj = new Database.Connection();
     if (txtEmail.Text.ToString().Equals("") && txtMsg.Text.ToString().Equals("") && txtName.Text.ToString().Equals(""))
     {
         rslt.InnerHtml = "Fill all details ";
     }
     else
     {
         obj.cmdquery("insert into contact (name,Email,Msg) values ('" + txtName.Text.ToString() + "','" + txtEmail.Text.ToString() + "','" + txtMsg.Text.ToString() + "')");
         rslt.InnerHtml = "Thanks for  the query ";
         txtEmail.Text  = "";
         txtMsg.Text    = "";
         txtName.Text   = "";
     }
 }