[thelist] ASP.Net - Setting up SQL Express

Ken Schaefer Ken at adOpenStatic.com
Wed Mar 5 18:15:33 CST 2008


Hi,

>From your web.config it appears that you are attempting to login as aspdata at xxx.com - try changing this to <DomainName>\aspdata (I don't think this should matter, but let's make everything consistent all the way through)

Next, you need to do two things to allow this account permissions to your database:

a) You need to permit the <domainName>\aspdata account to login in to the SQL Server

b) You then need to permit that login access to the relevant database.

You can do both of these things using SQL Server Management Studio (or a command line tool if you prefer)

I'm not sure what you mean by Microsoft is recommending impersonation. Everything that anything does in Windows /always/ has a user identity of some kind  (the user context that the process is started as). Impersonation involves changing that user context to some other user. This can be useful in some situations, and completely unnecessary in others. Where are you seeing this recommendation to use impersonation?

Cheers
Ken

-----Original Message-----
From: thelist-bounces at lists.evolt.org [mailto:thelist-bounces at lists.evolt.org] On Behalf Of j s
Sent: Thursday, 6 March 2008 2:19 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] ASP.Net - Setting up SQL Express

I set up a couple of grid pages, on an intranet, and want to restrict access to them.  Was aiming for Windows authentication.  SQL Express was installed on the C: drive of windows 2003 server with .Net 3, IIS 6.  D: the intranet installed on it.  Ran aspnet_regsql.exe to generate aspnetdb.  TCP/IP was enabled in the SQL Server Configuration Manager.  I have a dummy account set up with active directory called aspdata.
In the web.config file it has
<clear />
<add name="LocalSQLServer" connectionString="Server=.\SQLEXPRESS:Database=aspnetdb;Trusted_Connection=Yes;">
<authentication mode="Windows" />
<identity impersonate="true" userName="aspdata at xxx.com" password="xxx">

In Visual Studio 2005, when I click on the web site administration tool  - then - Security an error comes back
Cannot open database "aspnetdb" requested by the login. The login failed. Login failed for user 'xxx\ASPDATA'.

So I tried to set up a login account in SQL Server Management Studio Express - still didn't work.

I had trouble updating the tables from the grid pages - and one of the things Microsoft recommended was using impersonation.  This is set up and working.

A while ago I set this up on my laptop flipped the database over to full sql and it ran fine - I didn't have to add alot of extra stuff in the web.config file.  So what ever is wrong - I need a really good guide to explain this.

So Ken - I know you are a real guru at this.  Any ideas?

Thanks
JS
----- Original Message ----
From: Ken Schaefer <Ken at adOpenStatic.com>
To: "thelist at lists.evolt.org" <thelist at lists.evolt.org>
Sent: Tuesday, March 4, 2008 10:01:49 PM
Subject: Re: [thelist] ASP.Net - Setting up SQL Express

Hi,

What is "over the network"?

When you say "you have setup a login" - what exactly did you do?

What is the exact error message you are getting?

When you say you want to use impersonation - which user are you impersonating?

Cheers
Ken

-----Original Message-----
From: thelist-bounces at lists.evolt.org [mailto:thelist-bounces at lists.evolt.org] On Behalf Of j s
Sent: Wednesday, 5 March 2008 9:12 AM
To: thelist at lists.evolt.org
Subject: [thelist] ASP.Net - Setting up SQL Express

Hello,

I'm having an incredibly difficult time setting up sql express for and .net windows authetication.  Does anyone know of a really complete guide to do this?  It's over a network - sql express is on c: and the intranet sits on d: of the server.  I've been using impersonation and an error msg comes up Cannot open database aspnetdb requested by the login.  The login failed.  I've created a login for this on sql express - but it's not working.

Thx
--

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !
--

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !
--

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !



More information about the thelist mailing list