如何把查询得到的值附给message.text?? objCommand.ExecuteNonQuery()没有返回知怎么赋值?用SqlDataReader 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 objCommand.ExecuteNonQuery()没有返回知怎么赋值?用SqlDataReader 怎么还是不行啊?Dim strConnection as String = "user id=sa;password=;" strConnection += "database=northwind;server=jet-server;" strConnection += "Connect Timeout=30" Dim re As String Dim strSql as string = "Select ImageDescription From ImageStore Where ImageID=23" Dim objConnection as New SqlConnection(strConnection) Dim objCommand as new SqlCommand(strSql,objConnection) dim objDataReader as sqlDataReader objConnection.Open() objDataReader = objCommand.ExecuteReader() message.text = objDataReader("ImageDescription") 楼上的兄弟,objCommand.ExecuteNonQuery()有返回值的,它返回受insert、update或delete命令影响的行数,但肯定不是楼主要的查询值!--------------------------------AspNetPager 免费分页控件4.2版发布,同时发布最新源代码,欢迎下载:http://www.webdiyer.com ibatis 语句怎么写 ? 传值用string.Format()的问题...... 取消按回车键提交整个表单 csdn登录那个校验码是干什么用的,输错了都能登录 VS2005下调用WEBCONFIG中的值出错 怎么给datagrid加个模板列 请问怎么设置动态加载的控件的坐标? ASP.NET (C#)全局變量問題 求一数据访问层 为什么我编译后,把cs文件删除,第一次可以运行,可是下次就不能运行呢!? 如何调用WebBrowse控件中的一个方法 用Table控件如何循环显示多行数据?
用SqlDataReader
Dim strConnection as String = "user id=sa;password=;"
strConnection += "database=northwind;server=jet-server;"
strConnection += "Connect Timeout=30"
Dim re As String
Dim strSql as string = "Select ImageDescription From ImageStore Where ImageID=23"
Dim objConnection as New SqlConnection(strConnection)
Dim objCommand as new SqlCommand(strSql,objConnection)
dim objDataReader as sqlDataReader
objConnection.Open()
objDataReader = objCommand.ExecuteReader()
message.text = objDataReader("ImageDescription")
AspNetPager 免费分页控件4.2版发布,同时发布最新源代码,欢迎下载:http://www.webdiyer.com