472,328 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Web forms and data access

I've been trying to connect to SQL Server 2000 through a web form created in
c#. As I created my connection object the data source test succeeded. I've
even tried the datapage wizard and I get the following message:

Login failed for user '\'.

I can successfully connect when creating a Windows application, just not
from a web form app.

Can anyone help? Thanks
Nov 15 '05 #1
1 1235
Ed,

The reason for this is that by default, ASP.NET runs under the local
ASPNET user account. This account doesn't have any rights to the network,
and I imagine that is the problem.

In order to get around this, you will have to change the user that this
page runs under (or even the operation). You have three options:

- Elevate the rights of the ASPNET user so that it can access the database
(not a preferred option).

- Change the user that the web app runs under (through the web.config file)
so that it runs under a user that has rights. You have to be careful
though, because all pages in the directory that the web.config file is in
will run under that user context.

- Imitate the user. Check the documentation for the Impersonate method on
the WindowsIdentity class to see how you can impersonate a user at will.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ed B" <eb********@rehabchicago.org> wrote in message
news:uZ**************@TK2MSFTNGP10.phx.gbl...
I've been trying to connect to SQL Server 2000 through a web form created in c#. As I created my connection object the data source test succeeded. I've even tried the datapage wizard and I get the following message:

Login failed for user '\'.

I can successfully connect when creating a Windows application, just not
from a web form app.

Can anyone help? Thanks

Nov 15 '05 #2

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

Similar topics

3
by: polytimi8 | last post by:
Hello, I would like to know if it is possible to create a form in Access2000, which would function like a calendar for 8 operating rooms in...
6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to...
1
by: Brad L. Meyer | last post by:
Hi all! Happy Holidays to all! I work for a nonprofit 501.3.c case management agency. All of the computers have MS ACCESS database software...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a...
2
by: carrionk | last post by:
Hi, Which are the options for publishing access information over an Intranet? Besides ADPs, are there any programs I can use for letting people...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas...
6
by: William F. Zachmann | last post by:
We've got a project going that involves moving an old web site with a massive dll written in C++ that produces most of the output from a SQL 7.0...
6
by: dbuchanan | last post by:
I have a Windows Forms application that accesses SQL Server 2k from a small local network. The application has been used for weeks on other systmes...
9
by: Bob Alston | last post by:
I am looking for electronic forms software that would integrate well with MS Access. I have a client for whom I built a client database to...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor,...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.