473,394 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

attaching SQL Server 2005 Express database in ASP.NET web application

Hi there

Please help! I'm at my wits' end...

I am using the System.Data.SQLClient namespace in an ASP.NET web application
to connect to a local instance of SQL Server 2005 Express.

Using "AttachDBFileName" in the connection string to attach to the database,
I can connect to the database if the ASPNET account is explicitly (a)
granted database access and (b) given "SELECT" permission, presumably
because the ASPNET account has limited permission by default.

I'm certain that I'm dealing with a permission issue: If I assign the ASPNET
account to the Administrators group, I can attach to and access the
database, but this is too scary for me (not to mention for my principals).
I've been told that I can let the ASPNET account impersonate the local user,
but the local user will not have been given explicit permission to access
the database (I'm using XCopy deployment with no knowledge of the ultimate
user's Windows domain\user details). Alternatively I've been told that I can
get the ASPNET process to run under the System account, but (i) this is
fairly risky too, (ii) I don't know how to do it, and (iii) I'm uncertain
whether it would work.

Am I missing something glaring?!!

Please help!

Best regards
Loane

Nov 19 '05 #1
2 1398
attach databases requires admin permission. this is due to security, if any
user could attach/detach, they access any database on the hard drive.

your best bet if to suppy an admin page, that does the attach, then grats
access to the asp.net process.

-- bruce (sqlwork.com)


"Loane Sharp" <lo************@hotmail.com> wrote in message
news:ug*************@tk2msftngp13.phx.gbl...
Hi there

Please help! I'm at my wits' end...

I am using the System.Data.SQLClient namespace in an ASP.NET web
application
to connect to a local instance of SQL Server 2005 Express.

Using "AttachDBFileName" in the connection string to attach to the
database,
I can connect to the database if the ASPNET account is explicitly (a)
granted database access and (b) given "SELECT" permission, presumably
because the ASPNET account has limited permission by default.

I'm certain that I'm dealing with a permission issue: If I assign the
ASPNET
account to the Administrators group, I can attach to and access the
database, but this is too scary for me (not to mention for my principals).
I've been told that I can let the ASPNET account impersonate the local
user,
but the local user will not have been given explicit permission to access
the database (I'm using XCopy deployment with no knowledge of the ultimate
user's Windows domain\user details). Alternatively I've been told that I
can
get the ASPNET process to run under the System account, but (i) this is
fairly risky too, (ii) I don't know how to do it, and (iii) I'm uncertain
whether it would work.

Am I missing something glaring?!!

Please help!

Best regards
Loane

Nov 19 '05 #2
Hi Bruce, Thanks for clarifying that.
It sounds like a great idea but I'm not sure exactly what you mean by the
following ...
your best bet if to suppy an admin page, that does the attach, then grats
access to the asp.net process.


How would I do this? Do you have any pointers?
Best regards
Loane
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Darryl Kerkeslager | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/sseoverview.asp SQL Server Express was developed with two distinct uses in mind. The first is as a server product,...
4
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at...
3
by: ljh | last post by:
(sorry if this posts twice....I waited several hours and didn;t see it - so here it is again.....) Perhaps I am somewhat dense.....but, I still need to know..... What do you need to do in...
2
by: Tor Inge Rislaa | last post by:
Database on remote server On the remote server where my ASP.NET application is located there is no SQL Server or SQL Server Express. When I test my application locally it works fine because...
5
by: Ted | last post by:
I am working on two versions of an application, one of which will be a windows forms application (which will need to be redistributable) and the other will be a web application. I have MS Visual...
5
by: Glen Buell | last post by:
Hi all, I have a major problem with my ASP.NET website and it's SQL Server 2005 Express database, and I'm wondering if anyone could help me out with it. This site is on a webhost...
2
by: itfetish | last post by:
I've just upgraded our WIndows 2003 (with SBS server) web server to .Net framework 2.0 (it had 1.1 before) As I have been working on a web parts page on my laptop, hosting it there, working...
3
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if...
10
by: =?Utf-8?B?UHVuaXQgS2F1cg==?= | last post by:
Hi, I am developing a windows application in VS.NET 2005. The application is database driven and I need to deploy it on a client's pc. How should I go about developing such an application. I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.