protected void AddNewCustomer(object sender, EventArgs e)
{
Control control = null;
if (GridView1.FooterRow != null)
{
control = GridView1.FooterRow;
}
else
{
control = GridView1.Controls[0].Controls[0];
}
string SlNo = (control.FindControl("txtSlNo") as TextBox).Text;
string Code = (control.FindControl("txtcode") as TextBox).Text;
using (SqlConnection con = new SqlConnection(""))
{
using (SqlCommand cmd = new SqlCommand())
{
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "INSERT INTO [Qtattemp] VALUES(@Code,@SlNo)";
cmd.Parameters.AddWithValue("@SlNo", SlNo);
cmd.Parameters.AddWithValue("@Code", Code);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
Jitendra KumarPosted Oct 5, 2015, 4:32 AM
Abhishek KumarPosted Oct 5, 2015, 4:01 AM
Sivajihero HeroPosted Oct 5, 2015, 3:24 AM
Abhishek KumarPosted Oct 5, 2015, 3:20 AM
Mukesh KumarPosted Oct 5, 2015, 3:11 AM
Sivajihero HeroPosted Oct 5, 2015, 3:08 AM
Mukesh KumarPosted Oct 5, 2015, 3:05 AM