@DD-var

Как сделать подключение к бд на другом пк?

подключаю локальную бд, на моем пк работает все, на другом не работает хотя путь к файлу задается автоматически
ругается именно на подключение к бд.

"************ Exception Text **************
System.Data.SqlClient.SqlException (0x80131904): 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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.) ---> System.ComponentModel.Win32Exception (0x80004005): Не удается найти указанный файл"

string file = @"\Database1.mdf";
            string path = Path.Combine(Environment.CurrentDirectory);
            string full_fille = path + file;
           connect = @"Data Source = (LocalDB)\MSSQLLocalDB; AttachDbFilename="+full_fille+";Integrated Security = True";


проект "https://yadi.sk/d/lORIhaWv0fXRlA"

5e8ff8b648847342021197.jpeg
  • Вопрос задан
  • 189 просмотров
Решения вопроса 1
firedragon
@firedragon
Не джун-мидл-сеньор, а трус-балбес-бывалый.
Вам четко сказали что
52 - Unable to locate a Local Database Runtime installation.

Поставьте sqlexpress. И все заведется.
Кроме того настройте подключение с использованием БД. Вариант с файлом он больше для разработки.
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы