Пример #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow Gv1 in GridView1.Rows)
        {
            clsregister        obj    = new clsregister();
            clsregistrationprp objprp = new clsregistrationprp();

            objprp.rollno     = Gv1.Cells[0].Text;
            objprp.acadmics   = Gv1.Cells[1].Text;
            objprp.hostelfee1 = Gv1.Cells[2].Text;
            objprp.busfee     = Gv1.Cells[3].Text;
            objprp.fine       = Gv1.Cells[4].Text;
            objprp.exam       = Gv1.Cells[5].Text;
            objprp.extra      = Gv1.Cells[6].Text;
            objprp.pending    = Gv1.Cells[7].Text;
            objprp.total      = "0";



            try
            {
                obj.data_entry(objprp);

                Label1.Text = "Records inserted successfully";
            }
            catch (Exception exp)
            {
                Label1.Text = exp + "error";
            }
        }
    }