English 中文(简体)
数据来源
原标题:Datatable ImportRow
DataSet dsUdpated = new DataSet()
DataTable dtUpdated = dsUpdated.Tables.Add();
dtUpdated = dsOriginal.Tables[0].Clone();   // Guarenteed ds.Tables[0] has rows
dsUpdate.Tables[0].ImportRow(row); // row is one of the filtered row in 

但是,NexRow公司似乎增加了一行。 但增加一行。 请帮助!

最佳回答

Here s what you re doing wrong.

DataTable dtUpdated = dsUpdated.Tables.Add();
dtUpdated = dsOriginal.Tables[0].Clone();

在第1行中,您宣布反对,并按<条码>的原样开始。 在数据表收集上添加。 在第二行,你正在寻找别的东西!

在代码第一行之后,可读到与<代码>更新后相同的物体,但变数本身并非经常提及该物体。 事实上,在第二行中,你将它设定为另一个物体,即另一个表格<代码>Clone(方法>的结果。 如果变数标明的物体与<代码>更新后,可[0]相同,则不再如此。 它类似于声明

int x = 5;
x = 6;

在第1行,<代码>x的价值为5。 第二,你将这一数值改为6。 同样,根据你的表格变量,这一数值是参考。 你先把一字改为另一字。 是否有意义?

表格一,then在数据表中添加该表。 ∗ 待印发。 表格[0]将包含<代码>d 原件的装饰结构。 页: 1

问题回答

请尝试:

DataTable dt=dsOriginal.Tables[0].Clone(); 
dsUpdated.Tables.Add(dt);
DataTable dtUpdated=dt;

请首先打上<代码> 可发射

DataTable dt=table.Clone();

foreach (DataRow row in table.Select("AirAvail_Id=0"))
{                     
    dtAirAvail.ImportRow(row);
}

This will work fine.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签