0

ich got some problems connecting to the database stored on a server in the local network. I tryed almost everything, but nothing helps. I got 2 Databases, MYSQL and MSSQL.
Configuration:
Server: 192.168.0.198
MYSQL Port: 3306
MSSQL Port: 1433

If i connect manuelly in Visual Studio it works, but if i copy the ConnectionString from the properties, it only connects to the MYSQL Database and not the MSSQL (same login, same password, same ip adress, but ports are different)

In Visual Studio is P3B-Server\P3BMSSQL for the server and db_Software for the database

Visual Studio Properties:
"Data Source=P3B-Server;Initial Catalog=db_Software;User ID=myUser;Password=mypassword"

But it doesnt work :/ I tryed

  1. "Data Source=P3B-Server..."
  2. @"Data Source=P3B-Server\P3BMSSQL..."
  3. "Data Source=192.168.0.198,1433..."
  4. "Data Source=tcp:192.168.0.198,1433..."

Still no connection to MSSQL Server, only MYSQL Server.

I`m connecting with HeidiSQL to both Databases and got
"Microsoft SQL Server (TCP/IP, experimental)" with 192.168.0.198, Port 1433, user=myUser and Password=mypassword" for the MSSQL Server and there it works.

Checked "connectionstrings.com", but no solution works for me.
PS: Other side is an ASP.NET application, which connects with

<connectionStrings>
        <add name="ApplicationServices" connectionString="Data Source=192.168.0.198;Initial Catalog=db_Software;User Id=myUser;Password=myPassword;" providerName="System.Data.SqlClient"/>
</connectionStrings>

(stored in Web.config) to the database. I need exact this for my C# application as a Connectionstring.
Please help me. Thanks !

1
  • if in visual studio your connection uses "P3B-Server\P3BMSSQL" it means that you are not using the sql default instance. so in the connection string you have to use it like this: "Data Source=192.168.0.198\P3BMSSQL" Commented Feb 4, 2015 at 11:52

1 Answer 1

2

<connectionStrings>
        <add name="ApplicationServices" connectionString="Data Source=192.168.0.198\P3BMSSQL;Initial Catalog=db_Software;User Id=myUser;Password=myPassword;" providerName="System.Data.SqlClient"/>
</connectionStrings>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.