0
I have encountered problems connecting to sql server by visual studio with Entity Framework 6. My connection worked normally and after I created a new project, I cannot access the database server. The service works normally.
My connection string is always giving error stating that the Initial Catalog keyword is not supported. I have already done the removal of this parameter and realized that everything that is after Data Source is considered as unsupported keyword.
public DataContext() : base("Data Source=localhost/sqlexpress;Initial Catalog=DocManager;User Id=sa;Password=123456; Integrated Security=false;")
{
}
Firewall is disabled to prevent port locking issues.
As an alternative I tried to make the connection by the server manager tool of Visual Studio itself, but to my disappointment, I can not make any connection from there and my server is not listed for connection.
Any suggestions that might help me solve this problem?
The exceptions I get are these:
- Keyword not supported: 'initial Catalog'.
- Instance-specific or network error when connecting to SQL Server. The server was not found or not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (Preview: Named Pipes Provider, error: 40 - Unable to open connection to SQL Server)
However the server is running. I have checked the server name and everything checks out.
When you run the project generates some
exception
? If yes, could you add her to the question?– Barbetta
Keyword not supported: 'initial Catalog'. Instance-specific or network error when connecting to SQL Server. The server was not found or not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (Preview: Named Pipes Provider, error: 40 - Unable to open connection to SQL Server)
– Leonardo Silva