473,394 Members | 1,752 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.

ASP 2.0 and SQL Server 2005, attaching a .mdf

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
4 5229
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
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

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
6
by: Skully | last post by:
If I have created my Web Application on my PC using command and connection objects (dragging them onto the forms from the Server Explorer window) how do I make it work when I deploy the application...
2
by: Loane Sharp | last post by:
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...
6
by: gerry | last post by:
I am almost at the end of my rope - I have to go through this process everytime a new version of studio is released or it is installed on a new machine - what a (^%&$^& pain. I am trying to...
7
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...
2
by: thersitz | last post by:
Hi, I have VStudio2005, SQLServer 2005 dev edition loaded on a windowsXP Pro machine. I installed it ok. I just attempted to load the Personal Web Site Starter Kit (I downloaded off...
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...
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...
9
by: dpatel75 | last post by:
I am trying to copy a database from a SQL 2000 SP3 Windows 2000 server to a 2005 SP2 Windows 2003 server. I am trying to use detach and attach method (have tried both within Management Studio and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.