你是不是想把GridView1里的某列替换掉,
GridView1.Rows[i].Cells[3].Text = SubStr(gIntro, 2); gIntro = Convert.ToString(mydrv["GoodsIntroduce"]); //这句好像有问题mydrv这个上面定义了,这样是取什么东西出来
GridView1.Rows[i].Cells[3].Text = SubStr(gIntro, 2); gIntro = Convert.ToString(mydrv["GoodsIntroduce"]); //这句好像有问题mydrv这个上面定义了,这样是取什么东西出来
分别在if 和else语句里,gIntro = Convert.ToString(mydrv["GoodsIntroduce"]);没有问题
从myds.Tables["vb_GoodsInfo"]中取值,然后保存到GridView1.Rows[i].Cells[3]中
都是从这里央得出来的,设断点看里面可以得到些什么,
mydrv = myds.Tables["vb_GoodsInfo"].DefaultView[i + (5 * GridView1.PageIndex)]; //按照分页获取数据集中数据位置,取出gridviewrow
gIntro = Convert.ToString(mydrv["GoodsIntroduce"]);
GridView1.Rows[i].Cells[3].Text = SubStr(gIntro, 2); //修改某列值