Not able to see the SQL Server 2008 instance in services - c#

I have a named instance of SQL Server 2008 called TEST on my local machine but I am not able to see the services related to that instance in Services.msc. All I can see is service named SQL Server (MSSQLSERVER). And when I try to connect to this instance using my C# application using the connection string :
Server=localhost\\TEST;Database=TESTDB;Trusted_Connection=True;
it throws me this exception :
A network-related or instance-specific error occurred 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: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified)
Kindly help

Related

Can't connect local mdf database file

I build a simple CRUD app in C# and used server based database file (.mdf) in my Project. My connection string is like this:
public string connectionString { get; set; } = $"Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=\"{AppDomain.CurrentDomain.BaseDirectory}Passwords.mdf\";Integrated Security=True";
In my computer application works fine just I want, but after send to my friend, he got error that can't connect or find SQL database. Error text is:
A network-related or instance-specific error occurred 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: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified
So we download SQL server express 2019 for him (I use 2017 by the way) and after that, still he get the same error. I dont understand what is the problem. Any succession?

Connection string is not valid in reporting services SQL Server 2012

I am getting following error every time I try to register new user in Reporting Services Form Authentication. I don't know how to get away from it. I am following the steps from here.
Error message is:
An error occurred while attempting to add the account. A network-related or instance-specific error occurred 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: SQL Network Interfaces, error: 25 - Connection string is not valid)
Any solution?
Your connection string is not correct. Test it in another tool other than your program if you have doubt. First thing to check is if the server is actually accessible as the message states The server was not found or was not accessible.

Error in Connecting to SQL Server from a web form

I want to connect SQL Server in my webform program.
I use this command :
Connection = new SqlConnection("server=sharmi-PC/MSSQL2012;database=PeopleDb;trusted_connection=true");
but I get an error :
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in PeopleManagement.BusinessLogic.dll
Additional information: A network-related or instance-specific error occurred 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)
My server name in SQL Server is
sharmi-PC\MSSQL2012
If you say yourself that your server name is
sharmi-PC\MSSQL2012
then why aren't you using that in your connection??
Use this:
Connection = new SqlConnection(#"server=sharmi-PC\MSSQL2012;database=PeopleDb;trusted_connection=true");
Use the proper notation for server/instance name - a backslash (as in sharmi-PC\MSSQL2012) - not a forward slash as you used (sharmi-PC/MSSQL2012) ....

How to solve this error message if my network is working well

i am trying to reach a network based server program(on visual studio 2013& sql server 2012). On another machine of course. I searched that error and it says my db or server is not open to remote reaches. But i am %100 sure they are reachable.(My program's recent version is also used in my computer and it reaches db and the server.) I am sure my addresses and networks are correct and working. And also checked the ports etc. These were all i could reach. Do you have any other solution or guesses those i can try?
Thanks for your help.
"ErrorMessage: Server DB ye ulaşamadı(Says server DB is not
reachable.) Info:Server - A network-related or instance-specific error
occurred 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) Yayin OrjErrorMessage: A network-related or
instance-specific error occurred 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)"

SQL SERVER ERROR (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I'm working on a website using ASP.NET, C# and mssql.
When I run the website on our local server it is working fine.
The following error occurs when I run it on a shared server:
A network-related or instance-specific error occurred 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: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified)
I don't know how to play with connection string now since I'm very new to this.
It is recommend to keep the connection string in web.config.
To create a valid connection string with SQL Server (either located on network or locally), use following steps:
Steps:
Create a Test.UDL file at your desktop.
Double click the file to see undermentioned Data Link Properties
Select provider i.e SQL Server in your case
Provide connection details i.e. server, username, password etc. in Connection tab.
Test Connection on connection tab and press "OK".
Open UDL file in notepad to see valid connection string.
UPDATE
check following link for creating UDL http://msdn.microsoft.com/en-us/library/e38h511e(v=vs.71).aspx
check following link for connection string Setting up connection string in ASP.NET to SQL SERVER

Categories