0

i registered my website on somee.com. for that i have uploaded MS SQL database. i was wrting this connection string in my code:

connectionString="metadata=res://*/nrcsaEntities.csdl|res://*/nrcsaEntities.ssdl|res://*/nrcsaEntities.msl;provider=System.Data.SqlClient;provider connection string="data source=My-PC;initial catalog=nrcsa;integrated security=True;multipleactiveresultsets=True;App=EntityFramework""

now as i registered somee.com is providing me new connection string that is:

workstation id=nrcsadb.mssql.somee.com;packet size=4096;user id=DuaZoya_SQLLogin_1;pwd=abcd;data source=nrcsadb.mssql.somee.com;persist security info=False;initial catalog=nrcsadb

i have changed connectiong string in file web.config by replacing this first connection string with provided connection string by somee.com

PROBLEM:

This replacement is generating warning that:

 System.ArgumentException: Keyword not supported: 'user id'.

how to solve this problem?

2
  • If you're using EF, you need to only replace the inner provider connection string. Commented Jan 1, 2014 at 17:54
  • @SLaks can you please explain me with example:) Commented Jan 1, 2014 at 17:57

4 Answers 4

4

In the web.config file ....

     <connectionStrings><add name="nameofConnection" connectionString="Data   Source=servername; Initial Catalog=DatabaseName; User ID=UserName; Password=Password;"/>  </connectionStrings>
 <system.web>
<compilation debug="false" targetFramework="4.0" />  </system.web>

you can edit target Framework according to you.

from : http://dotnet-developers-cafe.blogspot.in/2013/08/create-connection-string-in-aspnet.html

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

Comments

2

You're using Entity Framework.

Entity Framework has its own connection string which contains a reference to the EF metadata (metadata=...) as well as the inner connection string to connect to the actual database.

You need to insert your actual database connection string inside the EF connection seting, in the provider connection string=... section.
You will also need to add multipleactiveresultsets=True to their connection string; EF needs that setting.

8 Comments

now it is saying System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. how to solvw this ?
@TameenMalik: Your inner connection string is wrong. You may need to add integrated security=false
Thank's @SLaks .... now problem is [SqlException (0x80131904): Login failed for user ''.]
i am writing this : ` <connectionStrings> <add name="nrcsaEntities" connectionString="metadata=res://*/nrcsaEntities.csdl|res://*/nrcsaEntities.ssdl|res://*/nrcsaEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=nrcsadb.mssql.somee.com;initial catalog=nrcsadb;integrated security=False;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>`
@TameenMalik: That isn't the connection string they gave you.
|
2

As you are using entity famework, then your connection string will look like

<connectionStrings>
  <add name="BlogContext" 
        connectionString="metadata=res://*/BloggingModel.csdl|
          res://*/BloggingModel.ssdl| res://*/BloggingModel.msl;
          provider=System.Data.SqlClient 
          provider connection string=&quot;data source=[you somee.com connetion string];&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

what you need to do is simply change the value of data source from the actual connectionstring provided by somee.com

2 Comments

oh it says: System.ArgumentException: Keyword not supported: 'user id'.
try this connectionString="metadata=res://*/nrcsaEntities.csdl|res://*/nrcsaEntities.ssdl|res://*/nrcsaEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=user id=DuaZoya_SQLLogin_1;password=abcd;server=nrcsadb.mssql.somee.com;database=nrcsadb;multipleactiveresultsets=True;App=EntityFramework&quot;"
2

Don't replace the whole connection string. You will need to remove the Integrated Security = true section and replace it with user=DuaZoya_SQLLogin_1;password=abcd.

Also change the data source to nrcsadb.mssql.somee.com.

You pretty much just need to replace values in your existing connection string with the values provided.

6 Comments

now it is saying System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. how to solvw this ?
Did you specify the user and password explicitly and remove Integrated Security = true? Check the Connection Strings snap in in IIS and see what the user name and password are.
Make sure you specify the user and password they supply, and remove Integrated Security = true. You can just change the true to false if you want, so Integrated Security = false.
No. Set integrated security = false. And make sure your password is what they gave you.
Change user id to user. Change pwd to password. You have to use the original attributes that entity framework understands.
|

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.