C# Datatable 修改列的时 提示 列为只读

lanyjh lanyjh 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
现在分不多,今天赚点分,给大家提上来,很急,谢谢

SQL 语句
-----------------------
select clientinfo.ClientName as 单位,COUNT(distinct(customer.name)) as 总人数,
STR(SUM(ItemGroup.Price))as 总工作量,
(select xmzk from ClientTeamCost where ClientRegID=CustomerReg.ClientRegID and TeamID=CustomerReg.TeamID ) as 折扣,
SUM(case Department.DepartmentName when '超声心动图' then ItemGroup.Price else 0 end) as 超声心电图,
SUM(case Department.DepartmentName when '黑白B超' then ItemGroup.Price else 0 end)as 黑白B超,
------------------------
代码
-------------------------
for (int i = 0; i < t.Rows.Count; i++)
{
decimal momeny = Convert.ToDecimal(t.Rows[i][j].ToString()) * Convert.ToDecimal(t.Rows[i][3].ToString()) / 100;
System.Type ts = t.Rows[i][2].GetType();
t.Rows[i][2] = momeny.ToString();
}
-----------------------
描述
-----------------------
在遍历时给第2列重新赋值时, 提示“列“总工作量”为只读。”
但是给第一列赋值就不报错;
在sql语句中也转换成string类型了
------------------------
或者高手提供下,我怎么把黑白B超的值=sum()的出来的值*折扣
...全文
评论 6
收藏 已收藏
分享
返回顶部
lanyjh
C# 111,129 成员 642,540 内容