问题描述
我必须使用C#将值添加到表的最后一行中的空字段。
我应该对以下代码做出哪些更改,以便我可以将''thisRow''设置为表格中的最后一行而不是新行。
DataRow thisRow = thisDataSet.Tables [" Table"] .NewRow();
thisRow [" Exit_time"] = Exittime;
thisDataSet .Tables [" Table"]。Rows.Add(thisRow);
I have to add a value to an empty field in the last row of the table using C#.
What changes should i make to the following code so that i can set ''thisRow'' to last row in the table rather than to a new row.
DataRow thisRow = thisDataSet.Tables["Table"].NewRow();
thisRow["Exit_time"] = Exittime;
thisDataSet.Tables["Table"].Rows.Add(thisRow);
推荐答案
我想你误解了我说的话。在我的表中,最后一行在每列中都有数据,除了1列,它允许为null。现在我需要在最后一行的这一列中插入值。此列的值将是c#程序的输出。
I guess you misunderstood what i said. In my table the last row has data in every column except for 1 column, which allows null. And now i need to insert value into this column in the last row. The value of this column will be a output of the c# program.
这篇关于如何将DataRow类设置为Sql表的最后一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!