I have a problem connecting my .NET application to my database. As a database I use mysql on a raspberry pi on the same network as my .NET application.U can see my code in the code section.
string connetionString = null; connetionString = "server=192.168.0.206,1433; Initial Catalog=Galenus;User ID=xxx;Password=xxx";SqlConnection conn = new SqlConnection(connetionString); conn.Open(); Console.WriteLine("Connection Open !");conn.Close();
The error code i get is :
System.Data.SqlClient.SqlException HResult=0x80131904 Message=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: 0 - Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd.)
In Visual Studio I can manually set up a SQL server via "Server Explorer". I can access my server this way (so it works when i manually add a SQL server). The string I connect to via "Server Explorer" is generated automatically and is as follows: "server=192.168.0.206;user
id=xxx;database=Galenus" So in my case i just added the password and the port for the IP adress.
Does anyone know what I'm doing wrong? I've been looking for my mistake for 3 days.thanks for the assistance.
Brecht_M
Some screenshots
https://snipboard.io/EHUbs0.jpg
https://snipboard.io/1RF3yv.jpg