Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP.Net application unable to access database

Posted on 2008-10-02
3
Medium Priority
?
231 Views
Last Modified: 2013-12-17
Greetings all

I recently moved (copied) a database to a new machine. The application, developed in VWD 2005 Express, as a file-based system, using the internal web server, was recreated as a website application in VS2005. Coe was copied in from the old.

When i run my app, I get the following Cannot open database "Scribbles" requested by the login. The login failed. Login failed for user 'ICBLUENOTEBOOK\ASPNET'.

My original application was called Scribbles and the new one is SCribbles02, stored in C:\Inetpub\wwwroot\Scribbles02.

What do I need to do?


In advance, thanks!!!

   allanmark

Web. Config:
 
  <connectionStrings>
    <clear/>
 
    <!--<add name="BranchDB" connectionString="Data Source=localhost;    <add name="Scribble" connectionString="Data Source=localhost;Initial Catalog=Scribbles;Trusted_Connection=Yes;" providerName="System.Data.SqlClient"/>
 
    <add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=Scribbles;Trusted_Connection=Yes;" providerName="System.Data.SqlClient"/>
 
 
  </connectionStrings>

Open in new window

0
Comment
Question by:allanmark
3 Comments
 
LVL 7

Accepted Solution

by:
orcic earned 600 total points
ID: 22622988
check permissions for 'ICBLUENOTEBOOK\ASPNET' on Scribbles database
0
 
LVL 8

Assisted Solution

by:jtdebeer
jtdebeer earned 600 total points
ID: 22623020
I would move away from the trusted security for the database except when the dbase server is sitting on the same machine or same domain as the application server.

In your case looking at the user 'ICBLUENOTEBOOK\ASPNET' it does not seem like you are working on a domain.

Create a user in your database then change the web.config to submit the credentials using
Driver={SQL Server}; Server=server_name_or_address; Database=database_name; UID=username; PWD=password;

Also ensure via IIS that the user ASP.Net is granted access.
0
 

Author Closing Comment

by:allanmark
ID: 31512996
Manuy thanks!! My deepest apologies - I completely forgot about closign this one!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question