I have a MS SQL database in azure (database as a service). I want to connect to this database from my C# MVC application using Entity framework. I want to know what should be the connection string. Following is the connection string which I used to connect to my local database.
<add name="PortalDbContext" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;User Id=sa;Password=sa;Initial Catalog=DemoDB;" />
Thanks in advance
EDIT
<add name="PortalDbContext" providerName="System.Data.SqlClient" connectionString="server=dbserver.database.windows.net:1433;User [email protected];Password=sa;Initial Catalog=DemoDB;" />
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
<add name="PortalDbContext" providerName="System.Data.SqlClient" connectionString="server=dbserver.database.windows.net;User [email protected];Password=sa;Initial Catalog=DemoDB;" />
Login failed for user 'sa'.
<add name="PortalDbContext" providerName="System.Data.SqlClient" connectionString="Data Source=tcp:dbserver.database.windows.net,1433;Initial Catalog=DemoDB;Persist Security Info=False;User [email protected];Password=sa;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" />
Login failed for user 'sa'.

