班级结构
public class EmployeeDetails
{
public int Id { get; set; }
public string Name { get; set; }
public string Exp { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
员工详细信息列表
Id Name Exp
-- --------- --------
1 Bill 2 years
2 John 5 years
3 Doug 1 years
Run Code Online (Sandbox Code Playgroud)
我想删除一个字段表单列表对象Id
,如下面的输出
Name Exp
--------- --------
Bill 2 years
John 5 years
Doug 1 years
Run Code Online (Sandbox Code Playgroud)
谁都知道该怎么办?
与我分享
谢谢
我正在处理事务,并且在提到的代码中我遇到了一些问题.我没有提交事务,但是它将数据插入到我的数据库中.
$this->db->trans_begin();
$this->db->insert('tblorder',$data);
$orderid=$this->db->insert_id();
foreach ($orderItemList as $orderItemList) {
$orderitem = array('orderid' =>$orderid ,'productid' =>$orderItemList->productid ,'amount' =>$orderItemList->amount);
$this->db->insert('tblorderitem',$orderitem);
}
$this->db->trans_complete();
if ($this->db->trans_status() == 1) {
$this->db->trans_rollback();
return "true";
} else {
$this->db->trans_commit();
return "false";
}
Run Code Online (Sandbox Code Playgroud)
我回滚了事务,并且所有数据都被插入到我的数据库中.一定是什么问题?我无法得到它.
c# ×2
asp.net-mvc ×1
codeigniter ×1
generic-list ×1
iis ×1
iis-express ×1
list ×1
mysql ×1
php ×1
transactions ×1
windows ×1