7

I've been poking my brain around for a few days trying to figure this out.

I'm using winhost to host a SQL Server and I've looked up quite a few similar questions with the same issue but they all seemed to have some formatting error that was their issue.

What's wrong with my connection string?

<add name="ContactsDb"
     connectionString="Data Source=tcp:s10.winhost.com;Initial Catalog=DB_84426_webdevct;User ID=DB_84426_webdevct_user;Password=***********;Integrated Security=False;" 
     providerName="System.Data.EntityClient"/>
6
  • System.ArgumentException {"Keyword not supported: 'data source'."}. No inner exception. Commented Jan 27, 2015 at 4:29
  • 7
    In Provider, Have you tried System.Data.SqlClient. Check this MSDN URL: msdn.microsoft.com/en-us/library/ms178411(v=vs.100).aspx Commented Jan 27, 2015 at 4:33
  • That did the trick. Thank you so much. I feel like an idiot. -_- I thought for Entity Framework automagic databases I needed to use the EntityClient. Commented Jan 27, 2015 at 4:36
  • A quick question, for each DbContext, do I need a new MSSQL database? Or can I connect several DbContext's to the same connection as long as I provide them with different names? Commented Jan 27, 2015 at 4:38
  • 1
    I think You can use same connection.. Commented Jan 27, 2015 at 4:39

1 Answer 1

11

I had to change the provider name to System.Data.SqlClient from System.Data.EntityClient. I was mistaken in thinking I needed the EntityClient for the automagic powers of Entity Framework when connecting to an external SQL Server database. Thank you Paresh J.

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

Comments

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.