Re: deploy asp.net application with sql server express database

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



How about impersonation? If you are not familiar with it, the declaration
comes in the web.config file inside the <system.web> section and to
impersonate the connecting user, use
<identity impersonate="true"/>
or to impersonate a specific user, use
<identity impersonate="true" userName="domain\UserName"
password="whatever"/>


"Loane Sharp" <look_sharp_not@xxxxxxxxxxx> wrote in message
news:OtadlYUwFHA.2880@xxxxxxxxxxxxxxxxxxxxxxx
> Hi there
>
> I had no luck in getting the following question answered in the SQL Server
> newsgroups. Please point me in the right direction.
>
> Background: I am using the "System.Data.SqlClient" namespace and a
> SqlConnection() object to connect to a local SQL Server 2005 Express
> database from within VB code contained in <SCRIPT /> tags in an ASP.NET
> page. I use Windows authentication (ie. "Integrated Security=SSPI;") to
> connect to the database, and Windows then uses the (local)\ASPNET account
> to
> make a connection.
>
> Problem: Every week there is a new database to attach. Making use of the
> XCopy functionality with AutoClose enabled, I simply delete the old .mdf
> file, copy the new .mdf file to that directory, and then let the
> "AttachDBFilename=..." part of the connection string attach the database.
> The problem is, the database file I want to attach is created on a
> different
> SQL Server, and as such does not contain login and permissions for the
> local
> machine's ASPNET user account. At present I am manually adding the login
> (exec sp_grantlogin '(local)\ASPNET') and user (exec sp_grantdbaccess
> '(local)\ASPNET') each time I attach a new database. Surely there must be
> an
> automatic way?! I can but I'd prefer not to give the ASPNET account login
> and database access from the SQL Server that I use to create the
> databases,
> since that would mean keeping track of the various user, machine and
> network
> names, which would be a nightmare.
>
> Please help!
>
> Best regards
> Loane
>
>
>
>


.



Relevant Pages

  • Security implementation with custom app roles
    ... SQL server 2000 database using a trusted sql connection. ... How can I impersonate the user depending on various predefined ...
    (microsoft.public.sqlserver.security)
  • Idiomatic Expressions to Operating System Architecture: Transforming Rigids
    ... <Subject: Re: Idiomatic Expressions to Operating ... <endpoint during a single session * DATABASE + by ... <statements is a new feature of SQL Server 2005. ...
    (sci.math)
  • Re: MS Access DAO -> ADO.NET Migration
    ... William Vaughn ... Microsoft MVP ... Hitchhiker's Guide to Visual Studio and SQL Server ... My migration app works building a SSCE database file with imported data ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cluster will not fail over.
    ... > As far as the TCP/IP issue goes, you had to rebuild the cluster and were ... > able to restore the master database. ... > a cluster installation you'll have to revisit. ... >> This worked bringing up the sql server in minimal mode. ...
    (microsoft.public.sqlserver.clustering)
  • Re: MS Access DAO -> ADO.NET Migration
    ... full SQL Server and I see the logic you explained in a multi user ... allow two users to access the same database file Read/Write at any given ... The book was a pleasure to read after the gibberish that Microsoft 'puts ... Hitchhiker's Guide to Visual Studio and SQL Server ...
    (microsoft.public.dotnet.framework.adonet)