Code:
Imports System.Data.SqlClient
Public Class Form1
Private connectionString As String = GetConnectinString()
Private Connection As New SqlConnection(ConnectionString)
Private adapter As SqlDataAdapter
Private datast As DataSet
Private sql As String
Private app As String
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'IMDbDataSet.table3' table. You can move, or remove it, as needed.
Me.Table3TableAdapter.Fill(Me.IMDbDataSet.table3)
ComboBox1.SelectedIndex = 0
OpenSQLConnection()
End Sub
Private Function GetConnectinString() As String
Return "Data source=DESKTOP-52R55AK\SQLEXPRESS01;Initial Catalog=IMDb;" &
"Integrated Security=True; MultipleActiveResultSets=True"
End Function
'DESKTOP-52R55AK\SQLEXPRESS01
Code:
Private Sub Button7_Click_1(sender As Object, e As EventArgs) Handles Button7.Click
Dim dv As DataView
dv = New DataView(ds.Tables(0), "type = 'business' ", "type Desc", DataViewRowState.CurrentRows)
DataGridView1.DataSource = dv
End Sub