C#后台 给(dataset)ds添加一列并赋值,总说我(红色区域)输入字符串的格式不正确
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();
}
如题
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();
}
如题
...全文
相关推荐
GDAL图像格式转换
C#自带的图像转换操作,当图像太大时会出现内存问题,用GDAL的写文件方式可以避免,此为C#封装GDAL实现图像格式转换
C#三层结构搜素树节点
用三层实现 1.递归加载数据库中的父子关系表(数据在DBData文件夹下) 主窗体有建表sql 2.输出模糊字符串,在树控件中递归查找所有包含该文字的节点, 以红色显示并让该节点可见
asp.net 生成曲线图实现代码
里是从Dataset里的数据生成曲线图.
导出Excel表的方法
导出Excel表的方法导出Excel表的方法导出Excel表的方法导出Excel表的方法导出Excel表的方法导出Excel表的方法导出Excel表的方法导出Excel表的方法导出Excel表的方法
.NET开发&电子商务(一).doc
.NET开发&电子商务(一).doc


