[英]Is there an issue binding a result to a DataGridView with combo boxes with NHibernate
[英]Issue with displaying SQL result in DataGridView
我試圖在應用程序的數據網格視圖中顯示SQL查詢的結果。 下面的代碼是我寫的,但是它似乎無關緊要,我無法在窗體的datagridview中顯示任何內容。 誰能指出我正確的方向?
碼:
Sql = "SELECT * FROM jobList WHERE techID = " & TechScreenID & ""
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = C:\Users\Dave\Documents\joblist.mdb;"
con.ConnectionString = connection
con.Open()
Dim adapter As New OleDbDataAdapter(Sql, connection)
Dim results As New DataTable("result")
adapter.Fill(results)
con.Close()
dgwTechStatus.DataSource = results
您需要將datagridview的“ autogeneratecolumns”屬性設置為true,或將特定的綁定列添加到datagridview。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.