C#后台 给(dataset)ds添加一列并赋值,总说我(红色区域)输入字符串的格式不正确

lc12d lc12d 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
DataColumn filepath = new DataColumn("filepath", Type.GetType("System.String"));
filepath.AutoIncrement = true;
filepath.AutoIncrementSeed = 0;
filepath.AutoIncrementStep = 1;
ds.Tables["news"].Columns.Add(filepath);

for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
if (ds.Tables["news"].Rows[i]["content"].ToString().Length > 11)
ds.Tables["news"].Rows[i]["filepath"] = ds.Tables["news"].Rows[i]["content"].ToString().Substring(0,11)+"..."; else
ds.Tables["news"].Rows[i]["filepath"] = ds.Tables["news"].Rows[i]["content"].ToString();

}


如题
...全文
评论 4
收藏 已收藏
分享
返回顶部
lc12d
C# 111,129 成员 642,538 内容