Dim SQLParam As SqlClient.SqlParameter
Dim dtMyTable As New DataTable("MyTable")
Using cn1 As New SqlConnection(strConn4.ConnectionString)
cn1.Open()
Dim da As New SqlDataAdapter("sp_ContactName", cn1)
da.SelectCommand.CommandType = CommandType.StoredProcedure
SQLParam = da.SelectCommand.Parameters.AddWithValue("@CustomerID", Me.ComboBox1.SelectedValue)
da.Fill(dtMyTable )
cn1.Close()
End Using
Dim vueMyView As DataView
vueMyView = New DataView
vueMyView .Table = dtMyTable
Me.DataGridView1.DataSource = vueMyView
|