Hay, I have a problem with this connectionstring.
Dim myConnectionAs New Data.OleDb.OleDbConnection("Provider=SQLNCLI;Data Source=whatever-ja4lbq\sqlexpress;Initial Catalog=Account;Integrated Security=SSPI;")
I use this code to receive a value on a specific query
Public Sub readdata(ByVal myconnectionstringAs String)Dim mySelectQueryAs String = "SELECT UserName, Password FROM TAccount WHERE UseName ='" & TextBox1.Text & "'; and Password = '" & TextBox2.Text & "';"Dim mycommandAs New Data.OleDb.OleDbCommand(mySelectQuery, myConnection) myConnection.Open()Dim myreaderAs Data.OleDb.OleDbDataReader myreader = mycommand.ExecuteReaderWhile myreader.Read Label1.Text = myreader.GetString(1)End While myreader.Close() myConnection.Close()End Sub
But when it execute i receive this exeption
Login timeout expired
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
Is this mean that i can not make a connection to my sql server 2005.
My sql server 2005 runs on my developer computer
By default SQL Server 2005 does not allow remote connections. Select Start -> All programs-> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server 2005 Surface Area Configuration. When the tool opens, pick "Surface Area Configuration for Services and Connections", when you get a tree view of all configurable services. Under "Database engine", there's a "remote connections" leaf, from which you can enable remote connections. You need also turn Sql Server Browser service on (since you use instance name in connection string)
More information:http://support.microsoft.com/kb/914277
|||And i must make some permission properties in my databases
Thanks
No comments:
Post a Comment