The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
Dim sql As String sql = "SELECT * FROM Departments where Customer = '" & customer & "'" ' This is our DataAdapter. This executes our SQL Statement above against the Database ' we defined in the Connection String Dim adapter As New OleDbDataAdapter(sql, con1) ' Gets the records from the table and fills our adapter with those. Dim dt As New DataTable("Departments") adapter.Fill(dt) If dt.Rows.Count = 0 Then MessageBox.Show("No record") Else ' Assigns our DataSource on the DataGridView dgv1.DataSource = dt Dim sql1 As String sql1 = "SELECT * FROM Departments" Dim adapter1 As New OleDbDataAdapter(sql1, con1) Dim cmd1 As New OleDbCommand(sql1, con1) 'Dim dt1 As New DataTable("Departments") con1.Open() Dim myreader As OleDbDataReader = cmd1.ExecuteReader myreader.Read() con1.Close() End If