Hi all; i'm trying to connect my program to an SQL Server Express database... however i am just getting an error that simply states:
"Login failed for user 'sa'."
Within my code this appears on:
objConnection.Open()
my code so far is:
Imports System.Data.SqlClient
Imports System.Data
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objConnection As SQLConnection = New _
SqlConnection("Server=[ServerName];Database=[DatabaseName];" & _
"user id=sa;password=")
Dim objCommand As SqlCommand = New SqlCommand()
objCommand.Connection = objConnection
objConnection.Open()
ComboBox1.Text = objCommand.CommandText = "SELECT DISTINCT UserName" & _
"FROM tblUsers;"
objConnection.Close()
End Sub
Essentially i am trying to connect to the Sql server database and draw the contents of the UserName column into the combobox.
Any advice on where i'm going wrong? Thanks