protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
SqlConnection MyNewConnection3 = new SqlConnection();
SqlCommand MyNewQuery3 = new SqlCommand();
MyNewConnection3.ConnectionString = "Data Source=.;Initial Catalog=FOREVER;User ID=sa;Password=1";
MyNewConnection3.Open();
MyNewQuery3.Connection = MyNewConnection3;
MyNewQuery3.CommandText = "SET DATEFORMAT DMY UPDATE IAS_ALLOCATIONS" +
" SET [AllQty] =" + GridView2.SelectedRow.FindControl("TextBox2").GetType() +
" WHERE AllocationID='" + GridView1.SelectedRow.Cells[1].Text.Trim() + "' " +
"AND Barcode='" + GridView2.SelectedRow.Cells[2].Text.Trim() + "' ";
//SqlCommand cmd = new SqlCommand(strSQL, cn);
//cmd.CommandTimeout = 0;
//if (cn.State == ConnectionState.Closed)
//{
// cn.Open();
//}
MyNewQuery3.ExecuteNonQuery();
MyNewConnection3.Close();
}
|