Guys please help me.

I am kinda new to ASP.net

Luckily I've manage log-in using forms authentication so that i could have a customize log-in page based on my Active Directory.
Now a Problem arise. I have to connect to my SQL EXPRESS database using the log-in I use. My SQL Express is using only windows authentication, and when I try to connect to SQL i get the error..

Cannot open database "DatabaseName" requested by the login. The login failed.

here is my web.config code

<configuration>

<connectionStrings>
  <add connectionString="LDAP://domain.com/DC=domain,DC=com" name="ADConnectionString" />
 </connectionStrings>
  <system.web>
<roleManager defaultProvider="AspNetWindowsTokenRoleProvider" />
<membership defaultProvider="MyADMembershipProvider">
  <providers>
    <add name="MyADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADConnectionString" enableSearchMethods="True" attributeMapUsername="sAMAccountName" />
  </providers>
 </membership>



    <!--membership provider entry goes here-->
    <authentication mode="Forms">
  		<forms name=".ADAuthCookie" timeout="10" />
	</authentication>

    <authorization>
      <deny users="?" />
      <allow users="*" />
    </authorization>
        <identity impersonate="true" />
  </system.web>
</configuration>

hope you guys can help me

Regards

Now I see where my problem is. The SQL logins are having the format of Domain\users while the authentication I am using in my domain is using sAMAccountName that is using a different format.

hope you guys can enlighten me about this

1) Can I use Form Authentication using "DOMAIN\USER""?

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.