Ejemplo n.º 1
0
        protected void update_button(object sender, EventArgs e)
        {
            ADOlayer ado = new ADOlayer();
            string   ex  = ado.updateRec(Convert.ToInt32(T1.Text), float.Parse(T2.Text.ToString()));

            label1.Text = ex;
        }
Ejemplo n.º 2
0
        protected void button1_click(object sender, EventArgs e)
        {
            int      eid   = int.Parse(TextBox1.Text);
            string   ename = Convert.ToString(TextBox2.Text);
            long     ssn   = long.Parse(TextBox3.Text);
            double   esal  = double.Parse(TextBox4.Text);
            DateTime dob   = Convert.ToDateTime(TextBox5.Text);
            int      did   = int.Parse(TextBox6.Text);
            ADOlayer ado   = new ADOlayer();

            ado.insertrecord(eid, ename, ssn, esal, dob, did);

            //string constr = "";
            //constr = ConfigurationManager.ConnectionStrings["myconstring"].ConnectionString;
            //try
            //{
            //    SqlConnection con = new SqlConnection(constr);

            //    con.Open();
            //    DataSet ds = new DataSet();
            //
            //    string query="insert into Employee (EmployeeId,EmployeeName,SSN,EmployeeSalary,DOB,Deptid) values("+eid+",'"+ename+"',"+ssn+","+esal+",'"+dob+"',"+did+")";
            //    SqlCommand cmd = new SqlCommand(query, con);

            //   int i=cmd.ExecuteNonQuery();
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ADOlayer ado = new ADOlayer();

            var stlist = ado.Getallrecords();

            GridView1.DataSource = stlist;

            GridView1.DataBind();
        }
Ejemplo n.º 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            ADOlayer ad    = new ADOlayer();
            int      Id    = Convert.ToInt32(Id1.Text);
            string   Sname = Sname1.Text;

            ad.UpdateRecord(Id, Sname);
            var t = ad.Getallrecords();

            GridView1.DataSource = t;
            GridView1.Dispose();

            ADOlayer ado    = new ADOlayer();
            var      stlist = ado.Getallrecords();

            GridView1.DataSource = stlist;
            GridView1.DataBind();
        }