By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,165 Members | 1,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,165 IT Pros & Developers. It's quick & easy.

ASP 2.0 and SQL Server 2005, attaching a .mdf

P: n/a
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|asp netdb.mdf;User Instance=true
WroxUnited data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttacheDBFilename=|DataDirectory|Wro xUnited.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|asp netdb.mdf;User Instance=true
WroxUnited data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttacheDBFilename=|DataDirectory|Wro xUnited.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_...rchTerms=37465
http://p2p.wrox.com/topic.asp?TOPIC_ID=37465
http://msdn.microsoft.com/library/de...ASPNET_SQL.asp
a couple more I can not locate now, one in particular that pointed out the
tcp/ip connections.
Mar 6 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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"
Mar 6 '06 #2

P: n/a
here is the site do download the application from:

http://www.wrox.com/WileyCDA/WroxTit...load_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|asp netdb.mdf;User Instance=true
WroxUnited data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttacheDBFilename=|DataDirectory|Wro xUnited.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|asp netdb.mdf;User Instance=true
WroxUnited data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttacheDBFilename=|DataDirectory|Wro xUnited.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_...rchTerms=37465
http://p2p.wrox.com/topic.asp?TOPIC_ID=37465
http://msdn.microsoft.com/library/de...ASPNET_SQL.asp
a couple more I can not locate now, one in particular that pointed out the
tcp/ip connections.

Mar 6 '06 #3

P: n/a

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

Mar 6 '06 #4

P: n/a
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"

Mar 6 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.