问题描述
我通过c#在datatable中添加了新行,但它降低了应用程序性能,请建议哪种方法是在数据表中添加新行而不影响性能的最快方法。
先谢谢。
我尝试过:
我试过
列表newRow =新列表();
//代码在列表中添加值
newRow.Add('10001') ;
datatable.Rows.Add(newRow.ToArray());
也试过
DataRow newRow = datatable.NewRow();
newRow [0] ='10001';
datatable.Rows.Add(newRow);
I adding new row in datatable by c#, but it slows down the application performance, please suggest which is fastest way to add new row in datatable without compromising performance.
Thanks in Advance.
What I have tried:
I tried
List newRow = new List();
//code to add values in list
newRow.Add('10001');
datatable.Rows.Add(newRow.ToArray());
also tried
DataRow newRow = datatable.NewRow();
newRow[0] = '10001';
datatable.Rows.Add(newRow);
推荐答案
这篇关于添加newrow in datatable减速性能。如何提高性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!