Solved

assistance rquired

Posted on 2008-10-21
8
459 Views
Last Modified: 2013-11-26
I have visual Studio 2008, I installed sql 2005 and sqlexpress2008.

the asp. net Configuration / Security thows this error:

Cannot open database "aspnetdb" requested by the login. The login failed. Login failed for user 'machinename\Username'.
need to configure it to work.
0
Comment
Question by:RahnLev
  • 4
  • 2
  • 2
8 Comments
 
LVL 76

Expert Comment

by:arnold
Comment Utility
Check the application event log.  Check to which SQL instance you are actually connecting.  i.e. you might be connecting to sql2005 while expecting that the connection would go to the sql2008 instance.  Double check the configuration and the port on which each listens.


0
 
LVL 16

Expert Comment

by:Gyanendra Singh
Comment Utility
check your connection string ...
refer this link for details
http://www.connectionstrings.com/
0
 

Author Comment

by:RahnLev
Comment Utility
When I build my website an error registers, this is the description:

The description for Event ID ( 0 ) in Source ( devenv ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: The data source '{130bada6-e128-423c-9d07-02e4734d45d4}' specifies no supporting providers or a set that are not registered..
0
 

Author Comment

by:RahnLev
Comment Utility
I configured the connection string in my machine.config to:

<connectionStrings>
            <add name="LocalSqlServer"
         connectionString="      data source=[machinename]\SQLEXPRESS2008;
                                          Integrated Security=SSPI;
                                          Database=aspnetdb;
                                          User Instance=true"      
        
                                          providerName="System.Data.SqlClient"/>
      </connectionStrings>
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 16

Expert Comment

by:Gyanendra Singh
Comment Utility
hmm so you are using window auth. right .... you need to add your user name and also grant access for that ...

else use sql auth...
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
It is highly ill advised to add IUSR_[machinename], IWAM_[machinename]  to the aspnetdb DB since (IUSR and IWAM)_[machinename] are the credential used by IIS to run.

You should use SQL auth as others have suggested.
0
 

Author Comment

by:RahnLev
Comment Utility
The problem is I cant get in to the asp. net Configuration from visual studio itself.
0
 

Accepted Solution

by:
RahnLev earned 0 total points
Comment Utility
OK, People...I solved this one very easily on my own, and by reading the forum topics, this is going to help quite a few of you.

 1.  Open Sql Server Configuration Manager and ensure that TCP/IP and Naming Pipe protocols are "enabled"

2.  run the aspnet_regsql.exe utility and it will create the database. !!WARNING!! If this doesn't work it is because you haven't started your SQL Server service or you are using the wrong login type.

3.  Edit the maching.config file (located C:\Windows\Microsoft.Net\Framework\V2.050727) like this:

<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DIRECTORY|\App_Data\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>

</connectionStrings>

PUT IN A LEGIT PATH WHERE IT SAYS |DIRECTORY| Example C:\Documents and Settings\Owner\My Documents\Visual Studio 2008\WebSites\LN9

NOTE:App_Data\aspnetdb.mdf is where the utility created your database.

 

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now