Rye
Rye

Reputation: 2311

Connection of MVC3 database to azure cloud server

I have tried connecting my webapp database to the azure cloud server using a connectionstring (provided by azure) from the web.config. But theres always an error that says "Format of the initialization string does not conform to specification starting at index 0."

Anyone encountered this error before? Please help.

connection string below :

<add name="SQLAzureConnection"
        connectionString="Server=tcp:mnftprvzdk.database.windows.net,1433;Database=mydb;User ID=user;Password=pass;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;"
        providerName="System.Data.SqlClient" />

Upvotes: 0

Views: 398

Answers (1)

Max
Max

Reputation: 3380

The user name should be user@machinename, (without the FULL DNS).

So in this case user@mnftprvzdk.

The format is:

Server=tcp:[serverName].database.windows.net;Database=myDataBase;
User ID=[LoginForDb]@[serverName];Password=myPassword;Trusted_Connection=False;Encrypt=True;

Upvotes: 1

Related Questions