DataGridView with multiple table
Display columns from two tables in one DataGridView
There're two ways.
One way is to use SQL( join )
one DataTable, one DataAdapter.
set "DataGridView.dataSource = DataTable". It's OK
It's very easy,but disadvantage is that you can not use "dataAdapter.update"
The other way is to use JoinView
two DataTables, two DataAdapters, one JoinView
The only drawback is that if you change the data of DataTable, the JoinView can't modify accordingly. You should write ReFill() method of JoinView
Public Sub ReFill(ByVal DataTable As DataTable)
Me.Clear()
Table = DataTable
Dim Row As DataRow
For Each Row In Table.Rows
List.Add(New JoinViewRow(Me, Row))
Next
End Sub
[@more@]
There're two ways.
One way is to use SQL( join )
one DataTable, one DataAdapter.
set "DataGridView.dataSource = DataTable". It's OK
It's very easy,but disadvantage is that you can not use "dataAdapter.update"
The other way is to use JoinView
two DataTables, two DataAdapters, one JoinView
The only drawback is that if you change the data of DataTable, the JoinView can't modify accordingly. You should write ReFill() method of JoinView
Public Sub ReFill(ByVal DataTable As DataTable)
Me.Clear()
Table = DataTable
Dim Row As DataRow
For Each Row In Table.Rows
List.Add(New JoinViewRow(Me, Row))
Next
End Sub
[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/55968/viewspace-1002315/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ssis multiple table to one file
- c#datagridview與oracle表table列對映關係C#ViewOracle
- Multiple Regression
- dataGridView繫結Dictionary |Dictionary繫結到DataGridViewView
- datagridView 去重View
- datagridview初始化View
- DataGridView使用 --轉載View
- DataGridView選中整行View
- DataGridView匯出ExcelViewExcel
- JavaScript select multipleJavaScript
- Small Multiple(最短路)
- Multiple Buffer Pools (83)
- Multiple Block Sizes (53)BloC
- C# Datagridview完整攻略C#View
- DataGridView網格顏色View
- WinForm:DataGridView新增加行ORMView
- Winform開發--資料從一個DataGridView轉移到另一個DataGridViewORMView
- 2.3.6.2 Synchronization of Multiple ApplicationsAPP
- Multiple Books多賬薄
- Multiple Render Targets in OpenGL with Cg
- MySql multiple servers on linuxMySqlServerLinux
- maven Multiple sourceDirectory外掛Maven
- Using Multiple Tablespaces (46)
- LLM multiple modal applicationsAPP
- android-Maintaining Multiple APKs,Creating Multiple APKs for Different API LevelsAndroidAIAPKAPI
- DataGridView顯示行號-RowPostPaintViewAI
- DataGridView控制元件用法合集View控制元件
- 列印DataGridView中的內容View
- Logstash Multiple Pipelines
- kubernetes traefik multiple namespacesnamespace
- Using Multiple Variables with the Same Name
- How to modify multiple items in the SAP menu
- C# DataGridView自動換行C#View
- DataGridView分頁功能的實現View
- 設定DataGridView垂直滾動條View
- win10版本multiple editions是什麼版本_win10版本multiple editions啥意思Win10
- HDU 6298 Maximum Multiple(找規律)
- Entity Framework Tutorial Basics(41):Multiple DiagramsFramework