Public Class Class1
Sub VerbindungListe(
ByVal X
As String)
Dim myDS
As New DataSet
Dim myAdapter
As OleDbDataAdapter
Dim sCON, sSQL
As String
Dim myOleCon
As OleDbConnection
Dim MyGanBezeichnungen
As New DataTable
Dim myDataColumn
As DataColumn
Dim myDataRow
As DataRow
sCON = "Provider=Microsoft.Jet.OLEDB.4.0
ata Source=" + "
:\Dinges Siegfried\DIPL" & _
"OM\net\db\gan.mdb"
Select Case X
Case "X58"
sSQL = "SELECT ID, Component, Symbol FROM GanBezeichnungen"
Case "X21"
sSQL = "SELECT [GanBezeichnungen].[ID], [GanBezeichnungen].[Component], [GanBezeichnungen].[Symbol]" & _
"FROM(GanBezeichnungen)" & _
"WHERE ((([GanBezeichnungen].[ID]
>=1
And ([GanBezeichnungen].[ID]
<=21));"
Case "X12"
sSQL = "SELECT [GanBezeichnungen].[ID], [GanBezeichnungen].[Component], [GanBezeichnungen].[Symbol]" & _
"FROM(GanBezeichnungen)" & _
"WHERE ((([GanBezeichnungen].[ID]
>=1
And ([GanBezeichnungen].[ID]
<=12));"
End Select
myOleCon =
New OleDbConnection(sCON)
myOleCon.
Open()
myAdapter =
New OleDbDataAdapter(sSQL, myOleCon)
myAdapter.Fill(myDS, "GanBezeichnungen"
myOleCon.Close()
''''''''''''''''''''''''''''''''tabelle bearbeiten''''''''''''''''''''''''''
MyGanBezeichnungen.TableName = "MyGanBezeichnungen"
myDataColumn =
New DataColumn
myDataColumn.ColumnName = "ID"
MyGanBezeichnungen.Columns.Add(myDataColumn)
myDataColumn =
New DataColumn
myDataColumn.ColumnName = "GASCOMPONETS"
MyGanBezeichnungen.Columns.Add(myDataColumn)
myDataColumn =
New DataColumn
myDataColumn.ColumnName = "SYMBOL"
MyGanBezeichnungen.Columns.Add(myDataColumn)
myDataColumn =
New DataColumn
myDataColumn.ColumnName = "MOLE-%"
MyGanBezeichnungen.Columns.Add(myDataColumn)
For i
As Integer = 0
To myDS.Tables("GanBezeichnungen"
.Rows.Count - 1
myDataRow = MyGanBezeichnungen.NewRow()
myDataRow("ID"
= myDS.Tables("GanBezeichnungen"
.Rows(i).Item(0)
myDataRow("GASCOMPONETS"
= myDS.Tables("GanBezeichnungen"
.Rows(i).Item(1)
myDataRow("SYMBOL"
= myDS.Tables("GanBezeichnungen"
.Rows(i).Item(2)
MyGanBezeichnungen.Rows.Add(myDataRow)
Next i
myDS.Tables.Add(MyGanBezeichnungen)
MyForm1.C1TrueDBGrid1.DataSource = myDS.Tables("MyGanBezeichnungen"
MyForm1.C1TrueDBGrid1.HScrollBar.Style = C1.Win.C1TrueDBGrid.ScrollBarStyleEnum.Always
MyForm1.C1TrueDBGrid1.VScrollBar.Style = C1.Win.C1TrueDBGrid.ScrollBarStyleEnum.Always
'TrueDBGridGrosseAnpassen
MyForm1.C1TrueDBGrid1.Columns(3).ValueItems.Validate =
True
For i
As Integer = 0
To 2
MyForm1.C1TrueDBGrid1.Splits(0).DisplayColumns(i).HeadingStyle.HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Near
MyForm1.C1TrueDBGrid1.Splits(0).DisplayColumns(i).AllowFocus =
False
MyForm1.C1TrueDBGrid1.Splits(0).FilterBar =
False
MyForm1.C1TrueDBGrid1.AllowUpdate =
True
MyForm1.C1TrueDBGrid1.AllowSort =
False
MyForm1.C1TrueDBGrid1.MultiSelect = C1.Win.C1TrueDBGrid.MultiSelectEnum.None
MyForm1.C1TrueDBGrid1.Splits(0).RecordSelectors =
False
MyForm1.C1TrueDBGrid1.Splits(0).FilterActive =
False
MyForm1.C1TrueDBGrid1.Splits(0).Style.BackColor = System.Drawing.Color.White
With MyForm1.C1TrueDBGrid1.Splits(0).DisplayColumns(MyForm1.C1TrueDBGrid1.Columns(i).Caption)
If i = 0
Then
.Width = 20
ElseIf i = 1
Then
.Width = 100
ElseIf i = 2
Then
.Width = 55
End If
End With
Next i
MyForm1.C1TrueDBGrid1.Columns(3).EditMask = "99.999"
MyForm1.C1TrueDBGrid1.Cursor = System.Windows.Forms.Cursors.IBeam
MyForm1.C1TrueDBGrid1.Splits(0).DisplayColumns(3).Style.HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Far
MyForm1.C1TrueDBGrid1.Splits(0).DisplayColumns(3).Style.Borders.BorderType = C1.Win.C1TrueDBGrid.BorderTypeEnum.Inset
MyForm1.C1TrueDBGrid1.ColumnFooters =
True
MyForm1.C1TrueDBGrid1.Columns(3).FooterText = "SUMME:"
MyForm1.C1TrueDBGrid1.Splits(0).DisplayColumns(3).FooterStyle.ForeColor = System.Drawing.Color.Blue
End Sub