c# - connecting to a database in visual studio for membership -


i have website created. in appdata folder created database (info.mdf).

i connected sqlexpress

i have added network service available users in sql mngmnt studio. went user mapping , added database. selected db_owner, public , aspnet_membership_fullaccess. did same process local username guess because of way setup database local user shows dbo under users in actual database.

i altered web.config say:

<?xml version="1.0"?> <!--   more information on how configure asp.net application, please visit   http://go.microsoft.com/fwlink/?linkid=169433   --> <configuration>   <connectionstrings>     <add name="membershipconnection" connectionstring="server=machinename\sqlexpress;  initial catalog=info;"          providername="system.data.sqlclient" />   </connectionstrings>   <system.web>       <compilation debug="true" targetframework="4.0"/>     <authentication mode="forms">       <forms loginurl="~/account/login.aspx" timeout="2880"/>     </authentication>     <membership defaultprovider="sqlprovider" userisonlinetimewindow="1720">       <providers>         <clear/>         <add name="aspnetsqlmembershipprovider" type="system.web.security.sqlmembershipprovider" connectionstringname="membershipconnection" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" requiresuniqueemail="false" maxinvalidpasswordattempts="5" minrequiredpasswordlength="6" minrequirednonalphanumericcharacters="0" passwordattemptwindow="10" applicationname="/"/>         <add name="sqlprovider"            type="system.web.security.sqlmembershipprovider"            connectionstringname="membershipconnection"            enablepasswordreset="true"            requiresquestionandanswer="false"            requiresuniqueemail="false"            maxinvalidpasswordattempts="10"            passwordattemptwindow="30"            minrequiredpasswordlength="3"            minrequirednonalphanumericcharacters="0"            applicationname="/" />        </providers>     </membership>     <rolemanager enabled ="true" />    </system.web>   <system.webserver>     <modules runallmanagedmodulesforallrequests="true"/>   </system.webserver> </configuration> 

i tried trusted_connection=yes in connection string integrated security=sspi

the error is:

[sqlexception (0x80131904): cannot open database "info" requested login. login failed. login failed user 'machinename\username'.]

ideas?

http://msdn.microsoft.com/en-us/library/ff647396.aspx

this link says in order windows authentication, must have

trusted_connection=yes 

or

integrated security=sspi 

in connection string. hope helps!


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -