| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 544 人关注过本帖
标题:新手菜鸟,求助!急!急!
只看楼主 加入收藏
安一心
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-12-15
收藏
 问题点数:0 回复次数:2 
新手菜鸟,求助!急!急!
求一个查询代码。
就是想让查询结果显示在一个文本框里 代码怎么写?
搜索更多相关主题的帖子: 查询 文本框 
2012-12-15 20:17
角角鱼
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-12-4
收藏
得分:0 
回复 楼主 安一心
Try
                conn.Open()
                Dim cmd_sel5 As New OleDbCommand(sel_str5, conn)
                Dim ds5 As New OleDbDataAdapter(cmd_sel5)
                Dim da5 As New DataSet()
                ds5.Fill(da5)
                TextBox_ownteam_shili.Text = da5.Tables(0).Rows(0)(0).ToString()
                conn.Close()
                cmd_sel5.Dispose()
                cmd_sel5 = Nothing
                ds5.Dispose()
                ds5 = Nothing
                da5.Dispose()
                da5 = Nothing
            Catch ex As Exception
                MessageBox.Show(ex.Message.ToString())
            End Try
2013-01-14 09:30
角角鱼
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-12-4
收藏
得分:0 
回复 楼主 安一心
Dim sel_str5 As String
            sel_str5 = "select shili from football_shili where county ='" & ComboBox_county.Text & "' and season = '" & TextBox_saiji.Text & "' and teamname='" & TextBox_ownteam.Text & "'"
            Try
                conn.Open()
                Dim cmd_sel5 As New OleDbCommand(sel_str5, conn)
                Dim ds5 As New OleDbDataAdapter(cmd_sel5)
                Dim da5 As New DataSet()
                ds5.Fill(da5)
                TextBox_ownteam_shili.Text = da5.Tables(0).Rows(0)(0).ToString()
                conn.Close()
                cmd_sel5.Dispose()
                cmd_sel5 = Nothing
                ds5.Dispose()
                ds5 = Nothing
                da5.Dispose()
                da5 = Nothing
            Catch ex As Exception
                MessageBox.Show(ex.Message.ToString())
            End Try
        End If
2013-01-14 09:32
快速回复:新手菜鸟,求助!急!急!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016249 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved