Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
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
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|SQL Time out only from one specific computer client||15||53|
|In VB.Net trying to download Sharepoint List to Excel and getting errors.||2||35|
|Updating Printer Details in VB.Net||16||42|
|can this macro be converted to sub procedure||4||33|
Join the community of 500,000 technology professionals and ask your questions.