- 积分
- 317
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-3-19
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
这是我的程序:
Public Class mainform
Private cnadonetconnection As New OleDb.OleDbConnection()
Private dadaataadapter As OleDb.OleDbDataAdapter
Private dtcontacts As New DataTable
Private Sub mainform_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
cnadonetconnection.Close()
cnadonetconnection.Dispose()
Private Sub mainform_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cnadonetconnection.ConnectionString = "provider=Sqloledb;Data Source=IP;Initial Catalog=AhGis2012;Persist Security Info=True;User ID=so;password=so"
cnadonetconnection.Open()
dadaataadapter = New OleDb.OleDbDataAdapter("select*from meso2012_hour", cnadonetconnection)
dadaataadapter.Fill(dtcontacts)
DataGridView1.DataSource = dtcontacts
End Sub
end class
运行后结果如图,然后我想选择其中的小时雨量列、stationID,将结果显示到文本框中,不知道怎么实现。
谢谢大侠指教一二。
|
|