Sunday 15 August 2010

c# - Can't correctly connect to SQL Server in ASP.NET application -


"postprint" itemprop = "text">

I have a SQL Server database already used for login credentials (among others) that all of the correct tables are I'm trying to connect to

I have this code in my web.config file:

   & Lt; / ConnectionStrings & gt;   

And when I open the Website Administration tool & gt; Security, I get the following error:

There is a problem with your selected data store This may be due to an invalid server name or credentials or insufficient permissions. This role can also be due to the managerial facility not being enabled. Click the button below to redirect to that page where you can choose a new data store.

The following messages can help diagnose the problem: Adding unfamiliar configuration sections (C: \ Documents and Settings \ Tunnel \ My Documents \ Visual Studio 2010 \ Web Sites \ zsrblank \ web.config line 7 )

I am trying to fix it for 5 hours when I have website administration tools & gt; Provider and test it always say:.

Successfully relation to the database

Please help

I followed this tutorial in fact and get the same error:

I think there is a slight typo here. In the tag, the property connectionstring should actually be connectionstring . Try it

  & lt; Connection Keystroke & gt; & Lt; Add name = "abcdCS" provider name = "System.Data.SqlClient" connectionString = "data source = SERVERNAME; initial catalog = SCRUMAPIUI; integrated security = false; user id = MYUSERNAME; password = MYPASSWORD; MultipleActiveResultSets = True" /> ; & Lt; / ConnectionStrings & gt;   

If the server and database names are correct and the user credentials are correct, then it should now work. Also make sure that your subscription and role providers in your web configuration are now using your new connection string. Something like this should be seen.

  & lt; Membership & gt; & Lt; Providers & gt; & Lt; Clear /> & Lt; Add name = "aspNetSqlMembershipProvider" type = "System.Web.Security.SqlMembershipProvider" enable connectionStringName = "abcdCS", password retrieval = "false" enable passwordResetset = "true" requires question and answer = "wrong" UniqueEmail = " False "maxInvalidPasswordAttempts =" 5 "minRequiredPasswordLength =" 6 "Minimum Required Nonfanumeric Alphabets =" 0 "PasswordAvsvindo =" 10 "Application Name =" / "/> & Lt; / Providers & gt; & Lt; / Subscription & gt;   

Also check that the role manager has been enabled.

  & lt; RoleManager enabled = "true" & gt;   

Hope this helps Good luck ...

No comments:

Post a Comment