ASP 2.0 and SQL Server 2005, attaching a .mdf

Discussion in 'ASP General' started by Greg P, Mar 6, 2006.

  1. Greg P

    Greg P Guest

    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 below). Please help me get
    through this!!!

    I'm having some serious problems attaching a .mdf file and accessing it. I
    have a WroxUntied.mdf that I want to attach and then run the website that
    uses it. This is a .mdf file from wrox books. This file to works correctly
    with sqlexpress, but I need to use Sql Server 2005.

    I have 2 different computer setups that I've tried this on. The first is a
    Windows Server 2003 R1 Domain Controller.

    1) Running Win Server 2003, VS2005 and SQL Server 2005 and IIS 6.0.
    2) Log into the server via a Domain account.
    3) Sql Server Setup
    a) I run aspnet_regsql.exe, which creates the aspnetdb database on my
    computer.
    b) SQL Server Configuration Manager - Allowed TCP/IP and Named Pipes
    c) SQL Server Surface Area Configuration - Allowed TCP/IP and Named Pipes
    e) There is a nt authority\network service login.
    c) In my main login page there is NOT an aspnet user
    f) I can not add the local machines NT AUTHORITY/NETWORK SERVICE (I
    think this is becuase I am logged on to the domain and not the local
    machine, maybe?)
    4) Unzip the wrox files:
    a) I unzip a zip file that has all needed files for the wrox help site.
    b) I add Network Service as a user to folder. ON THIS COMPUTER I CAN
    ONLY SELECT THE DOMAIN NETWORK SERVICE. THIS IS NOT THE LOCAL MACHINES
    NETWORK SERVICE
    5) Add a virtual dirctory:
    a) I created an alias and set the directory in a virtual directory in
    my default web sites.
    b) I make sure to set the ASP Version to 2.0XXXX.
    c) I have changed to connection string in the local WroxUnited
    (application name) web.config file from:
    LocalSqlServer "data source=.\SQLEXPRESS;Integrated
    Security=SSPI;AttacheDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
    WroxUnited data source=.\SQLEXPRESS;Integrated
    Security=SSPI;AttacheDBFilename=|DataDirectory|WroxUnited.mdf;User
    Instance=true
    to:
    LocalSqlServer "data source=localhost;Initial
    Catalog=aspnetdb;Integrated Security=true;"
    WroxUnited data source=localhost;Initial Catalog=WroxUnited;Integrated
    Security=true;
    6) WroxUnited Setup
    a) Attach the WroxUnited.mdf file
    b) In the security tab for the database both NT Authority/Network
    Service and ASPNET are users.
    7) I open up the Internet Explorer:
    a) enter http://localhost/WroxUnited
    b) I recived this error: A connection was successfully established with
    the server, but then an error occurred during the login process. (provider:
    Shared Memory Provider, error: 0 - No process is on the other end of the
    pipe.)
    c) I look at my sql server log and see this: Login failed for user 'NT
    AUTHORITY\NETWORK SERVICE'. [CLIENT: <local machine>]

    Some of my questions using the Server setup:
    1) The first is obviously how can I attach this mdf and make it work?
    What am I doing wrong? Why is this network service not working?
    2) When I look at my Active direcotry there is not an ASPNET user.
    Must I use my "SQLUser" (user I set up to use as a login for sql server)
    account to develop on my domain controller?
    3) If I wanted to use my laptop to access this sql server instance, how
    do I set that up? That way I could use VS2005 on my laptop and remove it
    from the server. I would think that this maybe a better development setup?

    I think the error has something to do with local vs domain network service
    accounts? But I'm not sure. I'm just trying to figure out how to attacheh
    this mdf correctly to sql server and run the app.

    So thinking this was the problem was with the Domain I have tried this on my
    laptop. I have a very similar setup on my laptop:
    1) Running windows xp pro with VS2005, SQL Sever 2005 and IIS 5.1.
    2) Log in locally (not the domain).
    3) Sql Server Setup
    a) I run aspnet_regsql.exe, which creates the aspnetdb database on
    my computer.
    b) SQL Server Configuration Manager - Allowed TCP/IP and Named
    Pipes, restared service.
    c) SQL Server Surface Area Configuration - Allowed TCP/IP and Named
    Pipes, restared
    e) Make sure there is both a NT AUTHORITY/NETWORK SERVICE and ASPNET
    login
    f) Map both NT AUTHORITY/NETWORK SERVICE and ASPNET to the aspnetdb.

    4) Add the wrox files
    a) unzip the files to C:\local code\WroxUnited
    b) add the LOCAL COMPUTERS NT AUTHORITY/NETWORK SERVICE account to the
    folder containing the .mdf file
    5) Open IIS Admin:
    a) create a Virtual Directory, set directory, set up alias.
    b) Make sure in the ASP.net setting ASP 2.0 is selected.
    c) edit the connection string for in the applications web.config from
    the default:
    LocalSqlServer "data source=.\SQLEXPRESS;Integrated
    Security=SSPI;AttacheDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
    WroxUnited data source=.\SQLEXPRESS;Integrated
    Security=SSPI;AttacheDBFilename=|DataDirectory|WroxUnited.mdf;User
    Instance=true

    to:

    LocalSqlServer "data source=localhost;Initial Catalog=aspnetdb;Integrated
    Security=true;"
    WroxUnited data source=localhost;Initial Catalog=WroxUnited;Integrated
    Security=true;
    6) WroxUnited.mdf setup.
    a) Attach the WroxUnited.mdf file under the name WroxUnited.
    b) In the security tab for the database both Network Service and
    ASPNET are users.

    7) Run the program:
    a) open http://localhost/WroxUnited in IE
    b) get the error: An error has occurred while establishing a
    connection to the server. When connecting to Sql Server 2005, this failure
    maye be cuased by the fact that under the dfault setting sql server doesn't
    allow remote connections. (provider: Named Pipes Provider, error: 40 -
    Could not open a connection to SQL Server)
    c) Check the Sql log and see nothing.


    Now this post has taken me over two hours to write and retest everything...
    LOL. any ideas on what I'm doing wrong? The main differnce between the two
    computers is 1)( logged on the local machine,2) running different OS which
    have different versions of IIS.

    web sites I've used to get information on this:
    http://p2p.wrox.com/topic.asp?TOPIC_ID=37298&SearchTerms=37465
    http://p2p.wrox.com/topic.asp?TOPIC_ID=37465
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/ConfigASPNET_SQL.asp
    a couple more I can not locate now, one in particular that pointed out the
    tcp/ip connections.
    Greg P, Mar 6, 2006
    #1
    1. Advertising

  2. Please do not multipost Greg.
    If this had been a classic ASP question, this is definitely a
    database-related question so .asp.db would have been the perfect group in
    which to post it. Posting it here as well did not increase your chances of
    getting an answer (most of us subscribe to both groups). On the contrary, if
    somebody had taken his time to answer it here, only to find that it was
    already resolved in the other group, that person may have been annoyed
    enough to ignore any future posts from you, thereby decreasing your chances
    of getting help in the future.

    There are times when you will not be sure which group is most appropriate
    (again, this was not one of them), and you will want to post a question to
    both groups. In that situation, you should use the cross-posting technique,
    rather than posting the same message multiple times. To crosspost, put a
    semicolon-delimited* list of the newsgroups to which you wish to post in the
    To: header of your post and post it once. It, and any replies to it, will
    appear in all the newsgroups in your list. So, if I reply in .asp.db, my
    reply will also appear here in .asp.general.

    * ... or whatever delimiter is recognized by your news client

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Mar 6, 2006
    #2
    1. Advertising

  3. Greg P

    Greg P Guest

    here is the site do download the application from:

    http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764588508,descCd-download_code.html

    it is the "Final Application.zip" file.

    "Greg P" wrote:

    > 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 below). Please help me get
    > through this!!!
    >
    > I'm having some serious problems attaching a .mdf file and accessing it. I
    > have a WroxUntied.mdf that I want to attach and then run the website that
    > uses it. This is a .mdf file from wrox books. This file to works correctly
    > with sqlexpress, but I need to use Sql Server 2005.
    >
    > I have 2 different computer setups that I've tried this on. The first is a
    > Windows Server 2003 R1 Domain Controller.
    >
    > 1) Running Win Server 2003, VS2005 and SQL Server 2005 and IIS 6.0.
    > 2) Log into the server via a Domain account.
    > 3) Sql Server Setup
    > a) I run aspnet_regsql.exe, which creates the aspnetdb database on my
    > computer.
    > b) SQL Server Configuration Manager - Allowed TCP/IP and Named Pipes
    > c) SQL Server Surface Area Configuration - Allowed TCP/IP and Named Pipes
    > e) There is a nt authority\network service login.
    > c) In my main login page there is NOT an aspnet user
    > f) I can not add the local machines NT AUTHORITY/NETWORK SERVICE (I
    > think this is becuase I am logged on to the domain and not the local
    > machine, maybe?)
    > 4) Unzip the wrox files:
    > a) I unzip a zip file that has all needed files for the wrox help site.
    > b) I add Network Service as a user to folder. ON THIS COMPUTER I CAN
    > ONLY SELECT THE DOMAIN NETWORK SERVICE. THIS IS NOT THE LOCAL MACHINES
    > NETWORK SERVICE
    > 5) Add a virtual dirctory:
    > a) I created an alias and set the directory in a virtual directory in
    > my default web sites.
    > b) I make sure to set the ASP Version to 2.0XXXX.
    > c) I have changed to connection string in the local WroxUnited
    > (application name) web.config file from:
    > LocalSqlServer "data source=.\SQLEXPRESS;Integrated
    > Security=SSPI;AttacheDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
    > WroxUnited data source=.\SQLEXPRESS;Integrated
    > Security=SSPI;AttacheDBFilename=|DataDirectory|WroxUnited.mdf;User
    > Instance=true
    > to:
    > LocalSqlServer "data source=localhost;Initial
    > Catalog=aspnetdb;Integrated Security=true;"
    > WroxUnited data source=localhost;Initial Catalog=WroxUnited;Integrated
    > Security=true;
    > 6) WroxUnited Setup
    > a) Attach the WroxUnited.mdf file
    > b) In the security tab for the database both NT Authority/Network
    > Service and ASPNET are users.
    > 7) I open up the Internet Explorer:
    > a) enter http://localhost/WroxUnited
    > b) I recived this error: A connection was successfully established with
    > the server, but then an error occurred during the login process. (provider:
    > Shared Memory Provider, error: 0 - No process is on the other end of the
    > pipe.)
    > c) I look at my sql server log and see this: Login failed for user 'NT
    > AUTHORITY\NETWORK SERVICE'. [CLIENT: <local machine>]
    >
    > Some of my questions using the Server setup:
    > 1) The first is obviously how can I attach this mdf and make it work?
    > What am I doing wrong? Why is this network service not working?
    > 2) When I look at my Active direcotry there is not an ASPNET user.
    > Must I use my "SQLUser" (user I set up to use as a login for sql server)
    > account to develop on my domain controller?
    > 3) If I wanted to use my laptop to access this sql server instance, how
    > do I set that up? That way I could use VS2005 on my laptop and remove it
    > from the server. I would think that this maybe a better development setup?
    >
    > I think the error has something to do with local vs domain network service
    > accounts? But I'm not sure. I'm just trying to figure out how to attacheh
    > this mdf correctly to sql server and run the app.
    >
    > So thinking this was the problem was with the Domain I have tried this on my
    > laptop. I have a very similar setup on my laptop:
    > 1) Running windows xp pro with VS2005, SQL Sever 2005 and IIS 5.1.
    > 2) Log in locally (not the domain).
    > 3) Sql Server Setup
    > a) I run aspnet_regsql.exe, which creates the aspnetdb database on
    > my computer.
    > b) SQL Server Configuration Manager - Allowed TCP/IP and Named
    > Pipes, restared service.
    > c) SQL Server Surface Area Configuration - Allowed TCP/IP and Named
    > Pipes, restared
    > e) Make sure there is both a NT AUTHORITY/NETWORK SERVICE and ASPNET
    > login
    > f) Map both NT AUTHORITY/NETWORK SERVICE and ASPNET to the aspnetdb.
    >
    > 4) Add the wrox files
    > a) unzip the files to C:\local code\WroxUnited
    > b) add the LOCAL COMPUTERS NT AUTHORITY/NETWORK SERVICE account to the
    > folder containing the .mdf file
    > 5) Open IIS Admin:
    > a) create a Virtual Directory, set directory, set up alias.
    > b) Make sure in the ASP.net setting ASP 2.0 is selected.
    > c) edit the connection string for in the applications web.config from
    > the default:
    > LocalSqlServer "data source=.\SQLEXPRESS;Integrated
    > Security=SSPI;AttacheDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
    > WroxUnited data source=.\SQLEXPRESS;Integrated
    > Security=SSPI;AttacheDBFilename=|DataDirectory|WroxUnited.mdf;User
    > Instance=true
    >
    > to:
    >
    > LocalSqlServer "data source=localhost;Initial Catalog=aspnetdb;Integrated
    > Security=true;"
    > WroxUnited data source=localhost;Initial Catalog=WroxUnited;Integrated
    > Security=true;
    > 6) WroxUnited.mdf setup.
    > a) Attach the WroxUnited.mdf file under the name WroxUnited.
    > b) In the security tab for the database both Network Service and
    > ASPNET are users.
    >
    > 7) Run the program:
    > a) open http://localhost/WroxUnited in IE
    > b) get the error: An error has occurred while establishing a
    > connection to the server. When connecting to Sql Server 2005, this failure
    > maye be cuased by the fact that under the dfault setting sql server doesn't
    > allow remote connections. (provider: Named Pipes Provider, error: 40 -
    > Could not open a connection to SQL Server)
    > c) Check the Sql log and see nothing.
    >
    >
    > Now this post has taken me over two hours to write and retest everything...
    > LOL. any ideas on what I'm doing wrong? The main differnce between the two
    > computers is 1)( logged on the local machine,2) running different OS which
    > have different versions of IIS.
    >
    > web sites I've used to get information on this:
    > http://p2p.wrox.com/topic.asp?TOPIC_ID=37298&SearchTerms=37465
    > http://p2p.wrox.com/topic.asp?TOPIC_ID=37465
    > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/ConfigASPNET_SQL.asp
    > a couple more I can not locate now, one in particular that pointed out the
    > tcp/ip connections.
    Greg P, Mar 6, 2006
    #3
  4. Greg P

    Mike Brind Guest

    Greg P wrote:
    > here is the site do download the application from:


    This is a classic asp news group. Dotnet is a different technology.
    If you haven't already, I suggest you post your question to
    microsoft.public.dotnet.framework.aspnet.

    --
    Mike Brind
    Mike Brind, Mar 6, 2006
    #4
  5. Greg P

    Greg P Guest

    Thanks Bob, I didn't know how to cross post until now. I appreciteate youre
    response and in now way would I want to annoy anyone. :)

    "Bob Barrows [MVP]" wrote:

    > Please do not multipost Greg.
    > If this had been a classic ASP question, this is definitely a
    > database-related question so .asp.db would have been the perfect group in
    > which to post it. Posting it here as well did not increase your chances of
    > getting an answer (most of us subscribe to both groups). On the contrary, if
    > somebody had taken his time to answer it here, only to find that it was
    > already resolved in the other group, that person may have been annoyed
    > enough to ignore any future posts from you, thereby decreasing your chances
    > of getting help in the future.
    >
    > There are times when you will not be sure which group is most appropriate
    > (again, this was not one of them), and you will want to post a question to
    > both groups. In that situation, you should use the cross-posting technique,
    > rather than posting the same message multiple times. To crosspost, put a
    > semicolon-delimited* list of the newsgroups to which you wish to post in the
    > To: header of your post and post it once. It, and any replies to it, will
    > appear in all the newsgroups in your list. So, if I reply in .asp.db, my
    > reply will also appear here in .asp.general.
    >
    > * ... or whatever delimiter is recognized by your news client
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >
    >
    Greg P, Mar 6, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Loane Sharp
    Replies:
    2
    Views:
    670
    Loane Sharp
    Oct 17, 2005
  2. =?Utf-8?B?R3JlZyBQ?=
    Replies:
    7
    Views:
    5,816
    Steven Cheng[MSFT]
    Mar 8, 2006
  3. Dave
    Replies:
    1
    Views:
    963
    Juan T. Llibre
    Jun 8, 2007
  4. Jeff
    Replies:
    3
    Views:
    4,453
    sloan
    Mar 6, 2008
  5. Cirene
    Replies:
    0
    Views:
    643
    Cirene
    May 21, 2008
Loading...

Share This Page