Error ,Sql Server,Login failed

Posted by Raja_89 under Visual Studio on 8/23/2013 | Points: 10 | Views : 2271 | Status : [Member] | Replies : 12
Hai
While creating a database in VS 2010[ASP.NET,C#] .How to overcome this error as "Login failed for user 'aa\b' [To create database ]
[In Server Explorer]
aa-PC Name
b-Server name

Share your answer as short as possible [Screenshots if possible ]



Regards




Responses

Posted by: Bandi on: 8/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Did you able to connect to SQL Server through SQL Server Management Studio(SSMS) with same credentials?
I think password is incorrect or you do not have access to that database...
Can you post Error code (SQL STATE)?

Refer this link it might help you
http://blog.sqlauthority.com/2009/08/20/sql-server-fix-error-cannot-open-database-requested-by-the-login-the-login-failed-login-failed-for-user-nt-authoritynetwork-service/

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
>>"Login failed for user 'aa\b' where aa-PC Name and b-Server name

You try only with ServerName or DomainName\ServerName
If not working, post us exact error with Error code, Severity, State


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 8/23/2013 [Member] Starter | Points: 25

Up
0
Down
This is the error while i try to connect
 Download source file

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 8/23/2013 [Member] Starter | Points: 25

Up
0
Down
How to reinstall the Sql Server 2005[First time it does not ask any password..etc]



Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 8/23/2013 [Member] Starter | Points: 25

Up
0
Down
Hai

How to add a new server name in Visual Studio's Server Explorer [which does not affect future process of OS]


Regards


Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
I doesn't have permission to download files... please post error message in the Description part only

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
>> How to add a new server name in Visual Studio's Server Explorer [which does not affect future process of OS]
I'm talking about connection string only.. not related to OS

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/23/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi Raja,
While adding connection to Visual Studio have you clicked on "Test Connection" button
Server Explorer in VS2010 --> Right Click on it and select Add Connection
-- >Enter Server Name
--> select Database name from drop down list under "connect to a database"
--> click on Test Connection

Then let me know the what you got whether succeed to connect or error...

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 8/24/2013 [Member] Starter | Points: 25

Up
0
Down
Hai
It displays the server name which is not there[where i created my database]
Example:
In Server Name it shows a,b, but i stored the details in C how can i add C to this
Is Server name is same as System name[ user name]



Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 8/24/2013 [Member] Starter | Points: 25

Up
0
Down
Hai
Yes i am performing insert and all other manipulation in Management Studio [SQL]

I have installed VS 2010 and then SQl Server 2005

Is it be a reason

Is the only chance to reinstall the SQL package and Viusal Stdio

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 8/24/2013 [Member] Starter | Points: 25

Up
0
Down
Hai
The error was
A network- related or instance -specific error occured while establishing a connection to SQL server.The server was not found or was not accessible.Verify that the instance name is correct and that SQL server is configured to allow remote connections[Provider:Named Pipes Provider ,error: 40 - Could not open a connection to SQL Server]

Hai Bandi
In your last post you have told to connect a based on a server name in Server name
In V.S 2010 Server Explorer my server name is displayed evenly


The options i saw

Data Connections

Servers
<>C
SharePoint Connections




Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/24/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
in SSMS run the following command
[code]SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')[/code]

This query should get you the server name and instance name :[code]SELECT@@SERVERNAME,@@SERVICENAME[/code]
In the server explorer in VS2010 add servername/instancename as servername while add connection

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response