classid是DataList控件名,原来是用ACCESS数据库用下面方法获取数据库的某个值
this.classid.SelectedValue = DB.FindString("select classid from info where id=" + id + "");
现在我改用sql2000数据库,并调用SqlHelper类取值,代码如下:
this.classid.SelectedValue = (int)SqlHelper.ExecuteScalar(SqlHelper.ConnectionString, CommandType.Text, "select classid from info where id=" + id + "", null);
显示:
CS0029: 无法将类型“int”隐式转换为“string”
请教高手,谢谢!!