hi, code is
string constr = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=master;Integrated Security=True";
SqlConnection connection = new SqlConnection(constr);
try
{
connection.Open();
MessageBox.Show("OK, Can Open!");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
connection.Close();
}
but it is not connected.
exception msg is "provider: SQL Network Interfaces, error: 56 ",
more exception info is "在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL Network Interfaces, error: 56 - 无法从注册表中指定的位置加载 SQLUserInstance.dll。请验证 SQL Server Express 的 Local Database Runtime 功能是否正确安装。"
if this windows has VS2019, these code is ok; but this windows is brand new , these code is not run .




