已解决问题

关于编辑GridView控件

5

public void GridViewShw(int intNewsClass_ID)
{

SqlParameter[] myParameter = new SqlParameter[1];

myParameter[0] = new SqlParameter["@intNewsClass_ID", intNewsClass_ID];

GridView1.DataSource = CHelper.ReturnCount("select * from tb_NewsInfo where NewsClass_ID = @intNewsClass_ID", myParameter, CommandType.Text);

GridView1.DataBind();
}

为什么报错?说我那个变量无法将类型“string”隐式转换为“int”

┽銏篨こ過詓 回答:1 人气:22 解决时间:2009-11-08 13:44
  
满意答案

这一行会报错:

myParameter[0] = new SqlParameter["@intNewsClass_ID", intNewsClass_ID];

那是因为你的参数类型不一致

零庹風
回答采纳率:72.8% 2009-11-08 13:37
评价答案
  • 是否解决问题(参与评价0次)
  • 6
  • 0
  • 0
  • 是否原创答案(参与评价0次)
  • 6
  • 0

相关内容