Allow setting Port when using MSSQL, fixes #1884

This commit is contained in:
Faryan Rezagholi
2021-08-15 20:13:59 +02:00
parent 98e7250b3c
commit 2f52473566
2 changed files with 5 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- #1690: Replaced GeckoFX (Firefox) with CefSharp (Chromium)
- #1325: Language resource files cleanup
### Fixed
- #1884: Allow setting Port when using MSSQL
- #1783: Added missing inheritance properties to SQL scripts
- #1773: Connection issue with mysql - Missing fields in
- #1756: Cannot type any character on MultiSSH toolbar

View File

@@ -53,9 +53,12 @@ namespace mRemoteNG.Config.DatabaseConnectors
private void BuildDbConnectionStringWithCustomCredentials()
{
string[] hostParts = _dbHost.Split(new char[] { ':' }, 2);
var _dbPort = (hostParts.Length == 2) ? hostParts[1] : "1433";
_dbConnectionString = new SqlConnectionStringBuilder
{
DataSource = _dbHost,
DataSource = $"{hostParts[0]},{_dbPort}",
InitialCatalog = _dbCatalog,
UserID = _dbUsername,
Password = _dbPassword,