protected void Button1_Click(object sender, EventArgs e)
        {
            InsertUser u = new InsertUser();

            u.Name  = TextBox1.Text;
            u.Email = TextBox2.Text;
            string r = client.Insert(u);

            lblmsg.Text = r.ToString();
        }
Пример #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text.Equals("") || TextBox1.Text.Equals(""))
     {
         lblmsg.Text = "Sorry, Column can't Empty!!!";
     }
     else
     {
         InserUser u = new InserUser();
         u.Name  = TextBox1.Text;
         u.Email = TextBox2.Text;
         string r = client.Insert(u);
         lblmsg.Text = r.ToString();
     }
 }
Пример #3
0
        protected void btInsert_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=DESKTOP-KT69I3S;Initial Catalog=WCFService;Persist Security Info=True;User ID=sa;Password=ifan99");

            con.Open();
            InsertUser u = new InsertUser();

            u.Name  = TextBoxName.Text;
            u.Email = TextBoxEmail.Text;
            string r = client.Insert(u);

            lblmsgInsert.Text = r.ToString();
            con.Close();
            TextBoxID.Text    = "";
            TextBoxName.Text  = "";
            TextBoxEmail.Text = "";
        }