473,465 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

No db access after publishing web site

I developed my first web site using Visual studio 2005.
It works very well with Visual Studio. But after I published the web site in
a file system folder in my PC using
the instructions I found in Visual studio help Walkthrough: Publishing a Web
Site, I can navigate the web forms
except the ones with connections (using Gridview, details view) to the
database (SQL Server 2005).

What didn't I do?

Thank you

Agos

Jun 8 '07 #1
7 2009
Sounds like your connection string needs to be different
at the server where you published your application to.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:6C******************@tornado.fastwebnet.it...
>I developed my first web site using Visual studio 2005.
It works very well with Visual Studio. But after I published the web site in a file system folder
in my PC using
the instructions I found in Visual studio help Walkthrough: Publishing a Web Site, I can navigate
the web forms
except the ones with connections (using Gridview, details view) to the database (SQL Server 2005).

What didn't I do?

Thank you

Agos

Jun 8 '07 #2
I published my application in the same file system (different folder) on
same PC.
This is the connection string I use
<add name="pagoConnectionString" connectionString="Data
Source=.\SQLEXPRESS;Initial Catalog=pago;Integrated Security=True;User
Instance=False"
The database is in folder
C:\Programmi\Microsoft SQL Server\MSSQL.1\MSSQL\Data
My working solution is in D:\WEB\WASP
I published in C:\WEB\WASP
and it also works except than the db WEB forms with gridview
"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2******************@TK2MSFTNGP02.phx.gbl...
Sounds like your connection string needs to be different
at the server where you published your application to.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:6C******************@tornado.fastwebnet.it...
>>I developed my first web site using Visual studio 2005.
It works very well with Visual Studio. But after I published the web site
in a file system folder in my PC using
the instructions I found in Visual studio help Walkthrough: Publishing a
Web Site, I can navigate the web forms
except the ones with connections (using Gridview, details view) to the
database (SQL Server 2005).

What didn't I do?

Thank you

Agos


Jun 8 '07 #3
1. Is the SQL Server Express database in the new application's App_Data folder ?

2. Are you detaching/attaching the SQL Server Express database correctly ?


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:Ox*******************@tornado.fastwebnet.it.. .
>I published my application in the same file system (different folder) on same PC.
This is the connection string I use
<add name="pagoConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial
Catalog=pago;Integrated Security=True;User Instance=False"
The database is in folder
C:\Programmi\Microsoft SQL Server\MSSQL.1\MSSQL\Data
My working solution is in D:\WEB\WASP
I published in C:\WEB\WASP
and it also works except than the db WEB forms with gridview
"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2******************@TK2MSFTNGP02.phx.gbl...
>Sounds like your connection string needs to be different
at the server where you published your application to.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:6C******************@tornado.fastwebnet.it.. .
>>>I developed my first web site using Visual studio 2005.
It works very well with Visual Studio. But after I published the web site in a file system
folder in my PC using
the instructions I found in Visual studio help Walkthrough: Publishing a Web Site, I can
navigate the web forms
except the ones with connections (using Gridview, details view) to the database (SQL Server
2005).

What didn't I do?

Thank you

Agos



Jun 8 '07 #4

1. Is the SQL Server Express database in the new application's App_Data
folder ?
================================================== =========
No it is in C:\Programmi\Microsoft SQL Server\MSSQL.1\MSSQL\Data
In there is only App_Data folder ASPNETDB.MDF

2. Are you detaching/attaching the SQL Server Express database correctly ?
================================================== =========
I never detach it since both point to C:\Programmi\Microsoft SQL
Server\MSSQL.1\MSSQL\Data
since both use the same connectionString
>

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:Ox*******************@tornado.fastwebnet.it.. .
>>I published my application in the same file system (different folder) on
same PC.
This is the connection string I use
<add name="pagoConnectionString" connectionString="Data
Source=.\SQLEXPRESS;Initial Catalog=pago;Integrated Security=True;User
Instance=False"
The database is in folder
C:\Programmi\Microsoft SQL Server\MSSQL.1\MSSQL\Data
My working solution is in D:\WEB\WASP
I published in C:\WEB\WASP
and it also works except than the db WEB forms with gridview
"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
>>Sounds like your connection string needs to be different
at the server where you published your application to.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:6C******************@tornado.fastwebnet.it. ..
I developed my first web site using Visual studio 2005.
It works very well with Visual Studio. But after I published the web
site in a file system folder in my PC using
the instructions I found in Visual studio help Walkthrough: Publishing
a Web Site, I can navigate the web forms
except the ones with connections (using Gridview, details view) to the
database (SQL Server 2005).

What didn't I do?

Thank you

Agos




Jun 8 '07 #5
I found the error.
Cannot open database "pago" requested by the login. The login failed. Login
failed for user 'XQ4\ASPNET'.
Now I have to find how to solve this :-)
Any help?

Thank you

Agos

"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP04.phx.gbl...
1. Is the SQL Server Express database in the new application's App_Data
folder ?

2. Are you detaching/attaching the SQL Server Express database correctly ?


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:Ox*******************@tornado.fastwebnet.it.. .
>>I published my application in the same file system (different folder) on
same PC.
This is the connection string I use
<add name="pagoConnectionString" connectionString="Data
Source=.\SQLEXPRESS;Initial Catalog=pago;Integrated Security=True;User
Instance=False"
The database is in folder
C:\Programmi\Microsoft SQL Server\MSSQL.1\MSSQL\Data
My working solution is in D:\WEB\WASP
I published in C:\WEB\WASP
and it also works except than the db WEB forms with gridview
"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
>>Sounds like your connection string needs to be different
at the server where you published your application to.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:6C******************@tornado.fastwebnet.it. ..
I developed my first web site using Visual studio 2005.
It works very well with Visual Studio. But after I published the web
site in a file system folder in my PC using
the instructions I found in Visual studio help Walkthrough: Publishing
a Web Site, I can navigate the web forms
except the ones with connections (using Gridview, details view) to the
database (SQL Server 2005).

What didn't I do?

Thank you

Agos




Jun 9 '07 #6
re:
!Cannot open database "pago" requested by the login. The login failed. Login
!failed for user 'XQ4\ASPNET'.
!It works very well with Visual Studio. But after I published the web
!site in a file system folder in my PC using

When you run any app using the Visual Studio Development Server, ASP.NET runs as
MachineName\WindowsLoggedInAccount, in your case, I'll venture that you're running
as Administrator, which would make the account XQ4\Administrator.

When you run any app using IIS, ASP.NET runs as the default account.
In your case, that's XQ4\ASPNET.

When you run the app in the VS internal web server, your login succeeds.

When you run the app in IIS, your login fails...because ASP.NET runs as
a different account...and you're using integrated security in your connection string.

So, your Windows Logged-In Account has permissions to the database, but XQ4\ASPNET doesn't.

Either grant XQ4\ASPNET access permissions to the database, or
change the authentication method for your connection to "mixed"
( instead of Windows only )...and use an ad-hoc SQL login account
to access your database ( that means changing your connection string ).


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:Bs******************@tornado.fastwebnet.it...
>I found the error.
Cannot open database "pago" requested by the login. The login failed. Login failed for user
'XQ4\ASPNET'.
Now I have to find how to solve this :-)
Any help?

Thank you

Agos

"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP04.phx.gbl...
>1. Is the SQL Server Express database in the new application's App_Data folder ?

2. Are you detaching/attaching the SQL Server Express database correctly ?
>Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:Ox*******************@tornado.fastwebnet.it. ..
>>>I published my application in the same file system (different folder) on same PC.
This is the connection string I use
<add name="pagoConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial
Catalog=pago;Integrated Security=True;User Instance=False"
The database is in folder
C:\Programmi\Microsoft SQL Server\MSSQL.1\MSSQL\Data
My working solution is in D:\WEB\WASP
I published in C:\WEB\WASP
and it also works except than the db WEB forms with gridview
"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2******************@TK2MSFTNGP02.phx.gbl.. .
Sounds like your connection string needs to be different
at the server where you published your application to.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:6C******************@tornado.fastwebnet.it ...
>I developed my first web site using Visual studio 2005.
It works very well with Visual Studio. But after I published the web site in a file system
folder in my PC using
the instructions I found in Visual studio help Walkthrough: Publishing a Web Site, I can
navigate the web forms
except the ones with connections (using Gridview, details view) to the database (SQL Server
2005).
>
What didn't I do?
>
Thank you
>
Agos

Jun 9 '07 #7
Thank you Juan,
after lots of try it seems I succseded!
here's what I did using the graphical tool of Sql server 2005:
USE [pago]
GO
CREATE USER [ASPNET] FOR LOGIN [XQ4\ASPNET]
GO

GRANT UPDATE TO [ASPNET]
GRANT SELECT TO [ASPNET]
GRANT INSERT TO [ASPNET]
GRANT EXECUTE TO [ASPNET]
GRANT CONNECT TO [ASPNET]

Maybe I could do better or in another way or maybe I did too much ......
Now this was just a try on my PC.
If I detach and attach this database on a different PC (according that PC
has the same name XP4) can I and my collegues from their own PC connect to
this WEB in an intranet environment?

Thank you

Agos

"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:uO**************@TK2MSFTNGP03.phx.gbl...
re:
!Cannot open database "pago" requested by the login. The login failed.
Login
!failed for user 'XQ4\ASPNET'.
!It works very well with Visual Studio. But after I published the web
!site in a file system folder in my PC using

When you run any app using the Visual Studio Development Server, ASP.NET
runs as
MachineName\WindowsLoggedInAccount, in your case, I'll venture that you're
running
as Administrator, which would make the account XQ4\Administrator.

When you run any app using IIS, ASP.NET runs as the default account.
In your case, that's XQ4\ASPNET.

When you run the app in the VS internal web server, your login succeeds.

When you run the app in IIS, your login fails...because ASP.NET runs as
a different account...and you're using integrated security in your
connection string.

So, your Windows Logged-In Account has permissions to the database, but
XQ4\ASPNET doesn't.

Either grant XQ4\ASPNET access permissions to the database, or
change the authentication method for your connection to "mixed"
( instead of Windows only )...and use an ad-hoc SQL login account
to access your database ( that means changing your connection string ).


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:Bs******************@tornado.fastwebnet.it...
>>I found the error.
Cannot open database "pago" requested by the login. The login failed.
Login failed for user 'XQ4\ASPNET'.
Now I have to find how to solve this :-)
Any help?

Thank you

Agos

"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>1. Is the SQL Server Express database in the new application's App_Data
folder ?

2. Are you detaching/attaching the SQL Server Express database correctly
?

>>Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:Ox*******************@tornado.fastwebnet.it ...
I published my application in the same file system (different folder) on
same PC.
This is the connection string I use
<add name="pagoConnectionString" connectionString="Data
Source=.\SQLEXPRESS;Initial Catalog=pago;Integrated Security=True;User
Instance=False"
The database is in folder
C:\Programmi\Microsoft SQL Server\MSSQL.1\MSSQL\Data
My working solution is in D:\WEB\WASP
I published in C:\WEB\WASP
and it also works except than the db WEB forms with gridview
"Juan T. Llibre" <no***********@nowhere.comha scritto nel messaggio
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
Sounds like your connection string needs to be different
at the server where you published your application to.
>
>
>
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Agos" <ag**************@fastwebnet.itwrote in message
news:6C******************@tornado.fastwebnet.i t...
>>I developed my first web site using Visual studio 2005.
>It works very well with Visual Studio. But after I published the web
>site in a file system folder in my PC using
>the instructions I found in Visual studio help Walkthrough:
>Publishing a Web Site, I can navigate the web forms
>except the ones with connections (using Gridview, details view) to
>the database (SQL Server 2005).
>>
>What didn't I do?
>>
>Thank you
>>
>Agos


Jun 9 '07 #8

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

Similar topics

0
by: John Bailey | last post by:
Okay, I am publishing a site done in ASP .Net 2.0. The site runs fine locally from source, I am publishing it mainly because two of the report assemblies do not come up on Crystal Tech when running...
0
by: tiendq | last post by:
Hi, My web application using a Http handler to handle request for *.aspx page in a specific folder e.g. /Articles , which generate requested page dynamically. It worked well. But when I...
1
by: philip | last post by:
I tried to publish on my address 'philippewarein.com' a minimal site. There is only one page, with some words : "This is my first site" This is the HTML code of this page, code created by Visual...
3
by: EqDev | last post by:
Hello I have set up a new windows server 2003 standard edition for training (on new software we have developed) and am having problems publishing webs to it from VS 2005. I have a C# Web...
74
by: ljh | last post by:
Why would you choose SQL Express (which requires an installed application to work) over the simplicity of an Access database which has no dependencies?
1
by: thavaht | last post by:
I recently began drawing dynamic pages using PHP + MYSQL. I’m developing the site on windows XP / Apache 1.3.34 / PHP 5.1.2 as a testing server. My publishing server is on another machine on the...
2
by: Max2006 | last post by:
Hi, After I right-click on my web application project file and choose "Publish ." and do the publishing, the result publishable files does not include the *.ashx files. Is it by design? How...
7
ADezii
by: ADezii | last post by:
There are essentially three techniques for publishing Access Data on the Web. The first technique is static, and does not allow for the dynamic addition or modification to the data, There is no...
0
by: ronald.chis | last post by:
Iwebs v1.2 - Open Source Web-Publishing Platform for Bloggers and website builders available Now- (Sept 16-2008) With more updations iwebs version 1.2 can be downloaded here -...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.