DataTable table =
{
SqlDataAdapter adapter =
adapter.Fill(table);
}
dgis.DataSource = table;
dgis.DataBind();
table.Rows.InsertAt(table.NewRow(), 0);
dgis.EditItemIndex = -1;
System.Web.UI.WebControls.TextBox st=
st=(System.Web.UI.WebControls.TextBox)e.Item.Cells[6].FindControl("txtobjach");
System.Web.UI.WebControls.TextBox st1=
st1=(System.Web.UI.WebControls.TextBox)e.Item.Cells[5].FindControl("txtobj");
System.Web.UI.WebControls.TextBox st2=
st2=(System.Web.UI.WebControls.TextBox)e.Item.Cells[4].Controls[0];
System.Web.UI.WebControls.TextBox st3=
st3=(System.Web.UI.WebControls.TextBox)e.Item.Cells[3].Controls[0];
System.Web.UI.WebControls.TextBox st4=
st4=(System.Web.UI.WebControls.TextBox)e.Item.Cells[2].Controls[0];
System.Web.UI.WebControls.RadioButtonList st5=
st5=(System.Web.UI.WebControls.RadioButtonList)e.Item.Cells[1].FindControl("rblmood");
System.Web.UI.WebControls.Image imgDaily =
imgDaily=(System.Web.UI.WebControls.Image)e.Item.Cells[1].FindControl("imgm");
System.Web.UI.WebControls.TextBox st6=
st6=(System.Web.UI.WebControls.TextBox)e.Item.Cells[0].FindControl("txtname");
SqlCommand myCommand=
myCommand.Connection=con;
myCommand.CommandText="insert into DashBoard (ObjectiveAchieved,Objective,MoodToday,Name) values (@ObjectiveAchieved, @Objective,@MoodToday,@Name)";
myCommand.Parameters.Add(
myCommand.Parameters["@ObjectiveAchieved"].Value=st.Text;
myCommand.Parameters["@Objective"].Value=st1.Text;
myCommand.Parameters["@Workinghrs"].Value=st2.Text;
myCommand.Parameters["@Loggedout"].Value=st3.Text;
myCommand.Parameters["@Loggedin"].Value=st4.Text;
myCommand.Parameters["@MoodToday"].Value=st5.SelectedValue;
myCommand.Parameters["@Name"].Value=st6.Text;
imgDaily.ImageUrl = "IS_dashboard/Moods/laughing.gif";
imgDaily.ImageUrl = "IS_dashboard/Moods/sad.gif";
con.Open();
myCommand.ExecuteNonQuery();
con.Close();
dgis.EditItemIndex=-1;
BindDataGrid();
Thanks.