I cannot connect to SQL server heres the code
Dim conn As New SqlClient.SqlConnection
conn.ConnectionString = "Data Source=|DataDirectory|\Books.sdf"
conn.Open() '\\ Error Comes here
Dim sqlcomm As SqlCommand = New SqlCommand(("SELECT MAX(ID) FROM Books"), conn)
maxid = sqlcomm.ExecuteNonQuery()
Error Prompts me as
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I know and have seen many posts on this probem but the solution there does not seem to help here what i have done so far
- Firewall Alows TCP Ports 1433 and 1434
- SQL Server Browser Enabled
- Remote Connections are alowed
- Connection string is correct
SO what seems to be the problem??? please help as it is urgent