I just try to connect on a SqlDatabse(running with Xampp) with a IP, but when i start to connect a Error shows up:
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: TCP Provider, error: 40 - Could not open a connection to SQL Server)\nA 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: TCP Provider, error: 40 - Could not open a connection to SQL Server)
here the Code:
string connetionString;
SqlConnection cnn;
connetionString = @"Data Source=(IP from Laptop with XAMPP);Initial Catalog=hoffmann;User ID=root;";
cnn = new SqlConnection(connetionString);
cnn.Open();
cnn.Close();