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”
请教高手,谢谢!!
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”
请教高手,谢谢!!
解决方案 »
- 如何动态添加GridView?
- asp.net 调用MSN
- 怎么查???
- 请问ajax翻页时,如何能看到其他页面的源文件
- 网站或论坛中怎么实现列举最新更新的帖子
- 如何读取DataSet里的有多少个横项字段!
- 请问如何给datalist或datagrid加分隔线,
- 这种嵌套的数据的checkbox(checkboxlist)如何实现?
- 请问错误提示The GridView 'GridView1' fired event RowDeleting which wasn't handled的是因为什么造成的?
- 请大家进来指点一下!!1
- asp.net 在图片上放控件
- 关于JS日期My97DatePicker控件触发后台事件的问题??
this.classid.SelectedValue = (int)SqlHelper.ExecuteScalar(SqlHelper.ConnectionString, CommandType.Text, "select classid from info where id=" + id , null);