Dim cs As New DataGridViewCellStyle
cs.Font = New Font("Ms Sans Serif", 10, FontStyle.Bold)
With showall
.ColumnHeadersDefaultCellStyle = cs
.Columns(0).HeaderText = "CustomerID"
.Columns(1).HeaderText = "CompanyName"
.Columns(2).HeaderText = "ContactName"
.Columns(3).HeaderText = "ContactTitle"
.Columns(4).HeaderText = "Address"
.Columns(5).HeaderText = "City"
.Columns(6).HeaderText = "Region"
.Columns(7).HeaderText = "PostalCode"
.Columns(8).HeaderText = "Country"
.Columns(9).HeaderText = "Phone"
.Columns(10).HeaderText = "Fax"
.Columns(0).Width = 100
.Columns(1).Width = 100
.Columns(2).Width = 100
.Columns(3).Width = 100
.Columns(4).Width = 100
.Columns(5).Width = 100
.Columns(6).Width = 100
.Columns(7).Width = 100
.Columns(8).Width = 100
.Columns(9).Width = 100
.Columns(10).Width = 100
End With
End Sub
Private Sub ShowAll_1()
Dim sql_c As String
sql_c = "select *"
sql_c &= " FROM Customers"
If IsFind = True Then
ds.Tables("Customers").Clear()
End If
da = New OleDbDataAdapter(sql_c, conn)
da.Fill(ds, "Customers")
If ds.Tables("Customers").Rows.Count <> 0 Then
IsFind = True
With showall
.ReadOnly = True
.DataSource = ds.Tables("Customers")
End With
Else
IsFind = False
End If
End Sub