小编Pra*_*iya的帖子

如何从列表中删除特定字段

班级结构

 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)

谁都知道该怎么办?
与我分享
谢谢

c# list generic-list generic-collections

4
推荐指数
1
解决办法
5265
查看次数

事务无法在codeigniter中回滚

我正在处理事务,并且在提到的代码中我遇到了一些问题.我没有提交事务,但是它将数据插入到我的数据库中.

$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)

我回滚了事务,并且所有数据都被插入到我的数据库中.一定是什么问题?我无法得到它.

php mysql transactions codeigniter codeigniter-3

4
推荐指数
1
解决办法
844
查看次数

2
推荐指数
1
解决办法
4083
查看次数

以编程方式使用C#更改目录(文件夹)图标

我想使用C#在Windows平台上更改特定文件夹图标的图标

c# windows

0
推荐指数
1
解决办法
1630
查看次数