Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention. Check out this how-to article for more information.
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strSQL As String strSQL = "" strSQL = "SELECT * FROM myDB.myOwner.myTable ORDER BY MyField" 'Establish connection and open database connection Dim objConnection As New SqlClient.SqlConnection("server=mySQLServer;database=myDB;user=myUser;pwd=MyPWD") 'Establish command object Dim objCommand As New SqlClient.SqlCommand(strSQL, objConnection) Dim objReader As SqlClient.SqlDataReader objConnection.Open() objReader = objCommand.ExecuteReader ComboBox1.DataSource = objReader objReader.Close() objConnection.Close() End Sub End Class
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.