DataTable.ImportRow is not adding rows

后端 未结 4 1796
我寻月下人不归
我寻月下人不归 2021-01-12 07:23

I\'m trying to make a DataTable and then add a couple rows to it. Here\'s my code:

using System;
using System.Collections.Generic;
using System.Linq;
using          


        
4条回答
  •  再見小時候
    2021-01-12 07:54

    You first need to add the row:

     dt.Rows.Add(dr);
    

    Then you must call below method to commit it:

     dt.AcceptChanges();
    

提交回复
热议问题