开发者

How to update a specific cell in a datatable based on search criteria in c#

开发者 https://www.devze.com 2023-03-14 19:15 出处:网络
I am working with a datatable that i would like to update. Here is what i am trying to do. I have a datatable with say 4 rows of data with columns such as Student ID, Student Grade and Absence Count.

I am working with a datatable that i would like to update. Here is what i am trying to do. I have a datatable with say 4 rows of data with columns such as Student ID, Student Grade and Absence Count.

When i get new information about the absence count, i want to search through the datatable by the开发者_如何学Go student id, isolate that row in the datatable and update the absence count cell with a new count. How can i do this? Here is what i have so far:

DataRow[] drr = dt.Select("Student ID='" + id + "'");
drr[0]["Student ID"] = count;

But how to commit these changes to the table itself?

0

精彩评论

暂无评论...
验证码 换一张
取 消