111,097
社区成员




public void update_detail(string appromoney, string indiobjid)
{
string sql1 = string.Format("UPDATE Indi_t_IndiBillDetail SET PlanMoney = " + appromoney + " WHERE (IndiObjID = '" + indiobjid + "')");
SqlCommand command = new SqlCommand(sql1, dbhelper.conn);
command.Connection.Open();
int scount = Convert.ToInt32(command.ExecuteNonQuery());
command.Connection.Close();
}
public void update_detail(string appromoney, string indiobjid)
{
SqlTransaction tx = dbhelper.conn.SqlConnection.BeginTransaction();
string sql1 = string.Format("UPDATE Indi_t_IndiBillDetail SET PlanMoney = " + appromoney + " WHERE (IndiObjID = '" + indiobjid + "')");
SqlCommand command = new SqlCommand(sql1, dbhelper.conn);
command.Connection.Open();
int scount = Convert.ToInt32(command.ExecuteNonQuery());
tx.commit();
command.Connection.Close();
}
加的两行代码前提是sql server数据库,如果lz用得不是sql server,请根据dbhelper.conn的类型自己判断。