Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能建议一下,我有一个包含 100 条记录的数据表,并且想根据 id 更新任何 1 条特定记录。
这是一个示例,即使您的要求不是很清楚,它也可能会有所帮助:
DataRow row = tableWith100Rows.AsEnumerable() .FirstOrDefault(r => r.Field<int>("ID") == 4711); if(row != null) row.SetField("ColumnToUpdate", "new value");