我在以下错误上cmd.ExecuteNonQuery。
" ExecuteNonquery要求命令在分配给命令的连接处于待处理的本地事务中时必须进行交易。命令的交易属性尚未初始化。"
这是我的代码:
//if (hdRefresh.Value.Length > done.Value.Length || done.Value == "1") //{ // //Write Your Add Customer Code here > Response.Write("true") // done.Value = hdRefresh.Value; //} //else //{ // Response.Redirect("~/Cashier/BTBill.aspx"); // return; //} if (IsClosedToDay()) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Warning", "<script>alert('Day Closing has been Performed ')</script>", false); return; } DateTime dateFeomDB = getdate(); // by atizaz if (HDD.Value == "" || HDD.Value == null) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Warning", "<script>alert('No Transaction Found')</script>", false); return; } // SqlConnection scon = new SqlConnection(ConfigurationManager....