0

Every time I have a fresh install of Windows, Visual Studio and Sql Server I always have problems getting an application to connect to the local instance of Sql Server.

I am trying to start an application using Entity Framework code first. Here is my connection string.

<add name="KCSoccerDataContext" 
     connectionString="Data Source=.\MSSQLSERVER;Initial Catalog=KCSoccer;Integrated Security=SSPI" 
     providerName="System.Data.SqlClient" />

I am able to connect to the database instance using Sql Server Management Studio, but can't seem to connect using this connection string. I am assuming the problem has to do with how the database instance is configured.

The error I'm getting is

{"The provider did not return a ProviderManifestToken string."}

I'm not exactly sure what this means or where to go from here.

Any help anyone could give on this would be awesome.

Thanks

4
  • Have you looked through here ? Commented Sep 26, 2012 at 4:57
  • Similar error message was caused by a login error. Check inner exception to get more information about the cause of the error. Similar question is here stackoverflow.com/questions/5423278/… Commented Sep 26, 2012 at 5:01
  • Yes, I always try to do some looking around before I ask a question. None of the suggestions on that thread are getting me anywhere. Again, I think it has something to do with my sql server instance being somehow misconfigured. Commented Sep 26, 2012 at 5:01
  • My inner exception is this: {"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: 25 - Connection string is not valid)"} --- So I guess I need help figuring out my connection string Commented Sep 26, 2012 at 5:05

2 Answers 2

3

Use just this connection string:

<add name="KCSoccerDataContext" 
     connectionString="Data Source=.;Initial Catalog=KCSoccer;Integrated Security=SSPI" 
     providerName="System.Data.SqlClient" />

MSSQLSERVER is name of default instance. It is not used in connection strings. It even doesn't work from Management studio if you try using it. Only names of custom instances must by used.

Sign up to request clarification or add additional context in comments.

Comments

0

You probably didn't enable remote connections for SQL Server since it's a fresh installation. Follow first solution here or here.

1 Comment

I think enabling remote connection should not be needed when the SQL server is on the same machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.