A
A
alexbbfg2016-05-15 21:28:18
SQL
alexbbfg, 2016-05-15 21:28:18

What is a sql server instance?

Good afternoon!
I am developing a C# application in Visaul Studio 2015 that works with sql database. I am a self-taught programmer, a practitioner without any theoretical education, I just google all the questions that arise, and then I struggle for a week and I can’t figure it out. Help me please.
There was a sql database and a project, in my opinion in 2012 studio. I made the database in some kind of sql management studio, I don’t remember which version. And so I had to return to the factory settings of the computer and everything that was reinstalled. I installed Visual Studio 2015, sql express 2014 and sql management studio 2014. I installed everything "by default" just clicked the button next, because I don't understand much about all this. After running the old project in Visual Studio 2015, it sees the database file, but with a red X, and when I click "test connection" it throws an error:
"The data source value in the connection string points to an uninstalled instance of SQL Server. To resolve this issue, install corresponding instance of SQL Server, or change the data source value in the connection string."
what is an instance of SQL Server? how to find it and how to install it? I installed SQL Server 2012, but it still gives me an error.
Many thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
res2001, 2016-05-16
@alexbbfg

MS SQL older than 2000 (if I'm not mistaken) introduced the concept of MS SQL instance. Those. on one computer there can be several MS SQL and they differ by the name of the instance.
The connection string to the MS SQL instance looks like this:
{ip or host}\{instance}
, where
ip or host is the IP address or host name where MS SQL
instance is installed - the name of the MS SQL instance.
The instance name is set when installing MS SQL. If you did not specify any instance name during installation, then most likely MS SQL was installed as default instance - without an instance name. Then the connection string to such an instance looks just like {ip or host}, i.e. without {instance}.
In addition, because If you installed MS SQL again, then you need to attach the database to your MS SQL instance. Here is an article about it: https://technet.microsoft.com/en-us/library/ms1656...

A
Anton Agaltsov, 2016-05-15
@Archusha

A database instance is a specific database. Usually the database has 4 details: Host (Localhost, 127.0.0.1 or another IP or DNS name), database name, login and password. The host and database name point to the database instance. A Login and password access to the database.
Most likely, after installation, you have changed the Host or the name of the database. You need to find the described details in your code and correct them for the correct ones.

Z
Zelimkhan Beltoev, 2016-05-15
@Beltoev

The data source value in the connection string points to an uninstalled instance of SQL Server. To resolve this issue, install an appropriate instance of SQL Server or change the data source value in the connection string.

After all, the error speaks for itself: when you try to open a database in the studio, it "picks up" the connection settings from the app.config file ( web.config , if a web application). Now, apparently, you have an invalid string that refers to a different version of SQL Server.
Here's what the connection string parameter should look like:
<connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>

Basically, usually, in different versions of SQL Server, only the " Data Source " parameter in this line changes.
Try, experiment

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question