I cannot connect to Sql server
The following is my codes in a Ado.net program:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cn As New SqlConnection("data source=localhost;initial catalog=pubs;user id=sa;password=li08yuan")
Dim cm As New SqlCommand("Select * from Authors", cn)
Dim dr As SqlDataReader
cn.Open()------'Procedure is stop here
dr = cm.ExecuteReader
dr.Read()
Response.Write("Name: " & dr("au_fname") & " " & dr("au_lname"))
dr.Close()
cn.Close()
End Sub
[622 byte] By [
liangchu] at [2007-11-11 8:02:01]

# 3 Re: I cannot connect to Sql server
Check SQL Server Service is running. Check that mixed mode authentication is enabled. Check that SQL Servier is installed as a default instance on the local computer.
Please post back with full details of any error messages.
# 4 Re: I cannot connect to Sql server
The error message is :System.Data.SqlClient.SqlException.
The user as 'sa' cannot connect to server on localhost.
# 6 Re: I cannot connect to Sql server
The error message :System.Data.SqlClient.SqlException and it says that user 'sa' login on SqlServer failure.I have tried to use password "li08yuan" but It has still not done.By the way,How to do run the SQL server.I'm beginner for SQL Server.thanks a lot.
# 7 Re: I cannot connect to Sql server
I don't know which version of SQL Server you are using but you can use Enterprise Manager to manage the database.
The sa user ID is blank by default. If you never changed the password then it should still be blank.