Friday, June 20, 2008

Getting ASP.NET Authentication in SQL Working

Firstly, you could go here, which helped me: http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

Otherwise, just go to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Run the aspnet_regsql.exe and following through the Next button.

If you want to setup a connection to your local machine running sql express, be sure to enter <machinename>\<sqlserver> for example: MATTSMACHINE\SQLEXPRESS

Everything should now be setup.

The next bit is optional, but I like to go to: http://msdn.microsoft.com/en-us/library/cc467894.aspx

Get the latest build of the Microsoft Enterprise Library. The setup is fairly simple, just install and follow the instructions for setting up the web.config and connection strings for allowing the data access layer. This will provide easy to use connection pooling and everything you need for single command SQL execution on your db.

The important entries in your web.config file should be:

<configSections>
<section name="dataConfiguration"...
...
</configSections>
<connectionStrings>
<add name="chopDatabaseConnection" providerName="System.Data.SqlClient"...
...
<dataConfiguration defaultDatabase="chopDatabaseConnection"/>

And you're away!

You might also want to read this:

No comments:

Post a Comment