diff --git a/mRemoteNG/Config/DatabaseConnectors/DatabaseConnectionTester.cs b/mRemoteNG/Config/DatabaseConnectors/DatabaseConnectionTester.cs index 3c3014e46..1517a4a8f 100644 --- a/mRemoteNG/Config/DatabaseConnectors/DatabaseConnectionTester.cs +++ b/mRemoteNG/Config/DatabaseConnectors/DatabaseConnectionTester.cs @@ -2,43 +2,128 @@ using Microsoft.Data.SqlClient; using System.Runtime.Versioning; using System.Threading.Tasks; +using System.Runtime.InteropServices; +using LiteDB; namespace mRemoteNG.Config.DatabaseConnectors { - [SupportedOSPlatform("windows")] + //[SupportedOSPlatform("windows")] /// /// A helper class for testing database connectivity /// + /// + using System; + using System.Data.SqlClient; + public class DatabaseConnectionTester { - public async Task TestConnectivity(string type, - string server, - string database, - string username, - string password) + //string connectionString = "Data Source=172.22.155.100,1433;Initial Catalog=Demo;User ID=sa;Password=London123"; + + public static void TestConnection(string connectionString) { - using (IDatabaseConnector dbConnector = DatabaseConnectorFactory.DatabaseConnector(type, server, database, username, password)) + try { - try + using (SqlConnection connection = new SqlConnection(connectionString)) { - await dbConnector.ConnectAsync(); - return ConnectionTestResult.ConnectionSucceded; - } - catch (SqlException sqlException) - { - if (sqlException.Message.Contains("The server was not found")) - return ConnectionTestResult.ServerNotAccessible; - if (sqlException.Message.Contains("Cannot open database")) - return ConnectionTestResult.UnknownDatabase; - if (sqlException.Message.Contains("Login failed for user")) - return ConnectionTestResult.CredentialsRejected; - return ConnectionTestResult.UnknownError; - } - catch (Exception) - { - return ConnectionTestResult.UnknownError; + connection.Open(); + Console.WriteLine("Connection successful!"); } } + catch (Exception ex) + { + Console.WriteLine($"Connection failed: {ex.Message}"); + } } } + //public class DatabaseConnectionTester + //{ + //public async Task TestConnectivity(string type, string server, string database, string username, string password) + //{ + //using IDatabaseConnector dbConnector = DatabaseConnectorFactory.DatabaseConnector(type, server, database, username, password); + //try + //{ + // Validate architecture compatibility + //if (!Environment.Is64BitProcess) + //{ + // throw new PlatformNotSupportedException("The application must run in a 64-bit process to use this database connector."); + // } + + // Attempt to connect + + //using (SqlConnection connection = new SqlConnection("Data Source=172.22.155.100,1433;Initial Catalog=Demo;Integrated Security=False;User ID=sa;Password=London123;Multiple Active Result Sets=True;Connect Timeout=30;Encrypt=True;Trust Server Certificate=True;Application Name=mRemoteNG;Application Intent=ReadOnly")) + //{ + // connection.Open(); + // Console.WriteLine("Connection successful!"); + //} + //Console.WriteLine($"{RuntimeInformation.OSArchitecture}"); + //Console.WriteLine($"{RuntimeInformation.ProcessArchitecture}"); + //try + //{ + // using (SqlConnection connection = new SqlConnection("Data Source=172.22.155.100,1433;Initial Catalog=Demo;Integrated Security=False;User ID=sa;Password=London123;Multiple Active Result Sets=True;Connect Timeout=30;Encrypt=True;Trust Server Certificate=True;Application Name=mRemoteNG;Application Intent=ReadOnly")) + // { + // connection.Open(); + // Console.WriteLine("Connection successful!"); + // } + //} + //catch (Exception ex) + //{ + // Console.WriteLine($"Connection failed: {ex.Message}"); + //} + //} +/* + + + try + { + using (SqlConnection connection = new SqlConnection("Data Source=172.22.155.100,1433;Initial Catalog=Demo;Integrated Security=False;User ID=sa;Password=London123;Multiple Active Result Sets=True;Connect Timeout=30;Encrypt=True;Trust Server Certificate=True;Application Name=mRemoteNG;Application Intent=ReadOnly")) + { + connection.Open(); + } + } + catch (TypeInitializationException ex) + { + Console.WriteLine($"Type initialization error: {ex.InnerException?.Message}"); + } + + + //await dbConnector.ConnectAsync(); + return ConnectionTestResult.ConnectionSucceded; + } + catch (PlatformNotSupportedException ex) + { + // Log or handle architecture mismatch + Console.WriteLine($"Platform error: {ex.Message}"); + return ConnectionTestResult.UnknownError; + } + catch (DllNotFoundException ex) + { + // Handle missing native dependencies + Console.WriteLine($"Missing dependency: {ex.Message}"); + return ConnectionTestResult.UnknownError; + } + catch (BadImageFormatException ex) + { + // Handle architecture mismatch in native libraries + Console.WriteLine($"Architecture mismatch: {ex.Message}"); + return ConnectionTestResult.UnknownError; + } + catch (SqlException sqlException) + { + if (sqlException.Message.Contains("The server was not found")) + return ConnectionTestResult.ServerNotAccessible; + if (sqlException.Message.Contains("Cannot open database")) + return ConnectionTestResult.UnknownDatabase; + if (sqlException.Message.Contains("Login failed for user")) + return ConnectionTestResult.CredentialsRejected; + return ConnectionTestResult.UnknownError; + } + catch (Exception ex) + { + // Log unexpected errors + Console.WriteLine($"Unexpected error: {ex.Message}"); + return ConnectionTestResult.UnknownError; + } +*/ + // } + // } } \ No newline at end of file diff --git a/mRemoteNG/Config/DatabaseConnectors/MSSqlDatabaseConnector.cs b/mRemoteNG/Config/DatabaseConnectors/MSSqlDatabaseConnector.cs index 88061f875..893b41bc4 100644 --- a/mRemoteNG/Config/DatabaseConnectors/MSSqlDatabaseConnector.cs +++ b/mRemoteNG/Config/DatabaseConnectors/MSSqlDatabaseConnector.cs @@ -2,6 +2,7 @@ using System.Data.Common; using Microsoft.Data.SqlClient; using System.Threading.Tasks; +using static BrightIdeasSoftware.TreeListView; // ReSharper disable ArrangeAccessorOwnerBody @@ -9,7 +10,7 @@ namespace mRemoteNG.Config.DatabaseConnectors { public class MSSqlDatabaseConnector : IDatabaseConnector { - private DbConnection _dbConnection { get; set; } = default(SqlConnection); + private DbConnection _dbConnection { get; set; } = default!; private string _dbConnectionString = ""; private readonly string _dbHost; private readonly string _dbCatalog; @@ -58,10 +59,17 @@ namespace mRemoteNG.Config.DatabaseConnectors _dbConnectionString = new SqlConnectionStringBuilder { + ApplicationName = "mRemoteNG", + ApplicationIntent = ApplicationIntent.ReadOnly, DataSource = $"{hostParts[0]},{_dbPort}", InitialCatalog = _dbCatalog, UserID = _dbUsername, Password = _dbPassword, + IntegratedSecurity = false, + Encrypt = true, + TrustServerCertificate = true, + ConnectTimeout = 30, + MultipleActiveResultSets = true }.ToString(); } diff --git a/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.Designer.cs b/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.Designer.cs index 91187ff6a..e7e5a7a58 100644 --- a/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.Designer.cs +++ b/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.Designer.cs @@ -20,195 +20,229 @@ namespace mRemoteNG.UI.Forms.OptionsPages [System.Diagnostics.DebuggerStepThrough()] private void InitializeComponent() { - lblSQLDatabaseName = new MrngLabel(); - txtSQLDatabaseName = new MrngTextBox(); - chkUseSQLServer = new MrngCheckBox(); - lblSQLUsername = new MrngLabel(); - txtSQLPassword = new MrngTextBox(); - lblSQLServer = new MrngLabel(); - txtSQLUsername = new MrngTextBox(); - txtSQLServer = new MrngTextBox(); - lblSQLPassword = new MrngLabel(); - btnTestConnection = new MrngButton(); - imgConnectionStatus = new System.Windows.Forms.PictureBox(); - lblTestConnectionResults = new MrngLabel(); - chkSQLReadOnly = new MrngCheckBox(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SqlServerPage)); + lblRegistrySettingsUsedInfo = new System.Windows.Forms.Label(); + lblSectionName = new System.Windows.Forms.Label(); + pnlServerBlock = new System.Windows.Forms.Panel(); + tabCtrlSQL = new System.Windows.Forms.TabControl(); + tabPage1 = new System.Windows.Forms.TabPage(); + pnlSQLCon = new System.Windows.Forms.TableLayoutPanel(); + txtSQLAuthType = new MrngComboBox(); + lblSQLAuthType = new MrngLabel(); lblSQLReadOnly = new MrngLabel(); lblSQLType = new MrngLabel(); txtSQLType = new MrngComboBox(); - pnlSQLCon = new System.Windows.Forms.TableLayoutPanel(); - pnlOptions = new System.Windows.Forms.Panel(); - lblRegistrySettingsUsedInfo = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)imgConnectionStatus).BeginInit(); + lblSQLServer = new MrngLabel(); + chkSQLReadOnly = new MrngCheckBox(); + lblSQLUsername = new MrngLabel(); + lblSQLPassword = new MrngLabel(); + txtSQLServer = new MrngTextBox(); + txtSQLPassword = new MrngTextBox(); + txtSQLUsername = new MrngTextBox(); + tabPage2 = new System.Windows.Forms.TabPage(); + tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + txtSQLDatabaseName = new MrngTextBox(); + lblSQLDatabaseName = new MrngLabel(); + numericUpDown3 = new System.Windows.Forms.NumericUpDown(); + numericUpDown2 = new System.Windows.Forms.NumericUpDown(); + mrngLabel19 = new MrngLabel(); + mrngComboBox4 = new MrngComboBox(); + mrngLabel18 = new MrngLabel(); + mrngLabel1 = new MrngLabel(); + mrngLabel9 = new MrngLabel(); + numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + tabPage3 = new System.Windows.Forms.TabPage(); + tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + mrngCheckBox5 = new MrngCheckBox(); + mrngLabel7 = new MrngLabel(); + mrngTextBox5 = new MrngTextBox(); + mrngLabel3 = new MrngLabel(); + mrngComboBox2 = new MrngComboBox(); + mrngCheckBox2 = new MrngCheckBox(); + mrngCheckBox4 = new MrngCheckBox(); + mrngCheckBox3 = new MrngCheckBox(); + mrngComboBox3 = new MrngComboBox(); + mrngLabel11 = new MrngLabel(); + mrngLabel12 = new MrngLabel(); + mrngLabel13 = new MrngLabel(); + mrngLabel14 = new MrngLabel(); + mrngLabel15 = new MrngLabel(); + mrngTextBox8 = new MrngTextBox(); + mrngLabel16 = new MrngLabel(); + mrngLabel17 = new MrngLabel(); + mrngTextBox11 = new MrngTextBox(); + tabPage4 = new System.Windows.Forms.TabPage(); + imgConnectionStatus = new System.Windows.Forms.PictureBox(); + lblTestConnectionResults = new MrngLabel(); + btnTestConnection = new MrngButton(); + btnExpandOptions = new MrngButton(); + tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + mrngTextBox2 = new MrngTextBox(); + mrngLabel4 = new MrngLabel(); + mrngLabel5 = new MrngLabel(); + mrngTextBox1 = new MrngTextBox(); + mrngLabel6 = new MrngLabel(); + mrngTextBox4 = new MrngTextBox(); + label1 = new System.Windows.Forms.Label(); + picboxLogo = new System.Windows.Forms.PictureBox(); + chkUseSQLServer = new System.Windows.Forms.CheckBox(); + pnlServerBlock.SuspendLayout(); + tabCtrlSQL.SuspendLayout(); + tabPage1.SuspendLayout(); pnlSQLCon.SuspendLayout(); - pnlOptions.SuspendLayout(); + tabPage2.SuspendLayout(); + tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)numericUpDown3).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit(); + tabPage3.SuspendLayout(); + tableLayoutPanel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)imgConnectionStatus).BeginInit(); + tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)picboxLogo).BeginInit(); SuspendLayout(); // - // lblSQLDatabaseName + // lblRegistrySettingsUsedInfo // - lblSQLDatabaseName.Dock = System.Windows.Forms.DockStyle.Fill; - lblSQLDatabaseName.Enabled = false; - lblSQLDatabaseName.Location = new System.Drawing.Point(3, 52); - lblSQLDatabaseName.Name = "lblSQLDatabaseName"; - lblSQLDatabaseName.Size = new System.Drawing.Size(154, 26); - lblSQLDatabaseName.TabIndex = 5; - lblSQLDatabaseName.Text = "Database:"; - lblSQLDatabaseName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + lblRegistrySettingsUsedInfo.BackColor = System.Drawing.SystemColors.ControlLight; + lblRegistrySettingsUsedInfo.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 204); + lblRegistrySettingsUsedInfo.ForeColor = System.Drawing.Color.IndianRed; + lblRegistrySettingsUsedInfo.Location = new System.Drawing.Point(3, 46); + lblRegistrySettingsUsedInfo.Name = "lblRegistrySettingsUsedInfo"; + lblRegistrySettingsUsedInfo.Padding = new System.Windows.Forms.Padding(0, 2, 0, 0); + lblRegistrySettingsUsedInfo.Size = new System.Drawing.Size(1128, 30); + lblRegistrySettingsUsedInfo.TabIndex = 24; + lblRegistrySettingsUsedInfo.Text = "Some settings are configured by your Administrator. Please contact your administrator for more information."; + lblRegistrySettingsUsedInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // txtSQLDatabaseName + // lblSectionName // - txtSQLDatabaseName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - txtSQLDatabaseName.Dock = System.Windows.Forms.DockStyle.Fill; - txtSQLDatabaseName.Enabled = false; - txtSQLDatabaseName.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - txtSQLDatabaseName.Location = new System.Drawing.Point(163, 55); - txtSQLDatabaseName.Name = "txtSQLDatabaseName"; - txtSQLDatabaseName.Size = new System.Drawing.Size(235, 22); - txtSQLDatabaseName.TabIndex = 6; + lblSectionName.BackColor = System.Drawing.SystemColors.ControlLight; + lblSectionName.Dock = System.Windows.Forms.DockStyle.Top; + lblSectionName.Font = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204); + lblSectionName.ForeColor = System.Drawing.SystemColors.ControlText; + lblSectionName.Location = new System.Drawing.Point(0, 0); + lblSectionName.Margin = new System.Windows.Forms.Padding(10, 10, 3, 0); + lblSectionName.Name = "lblSectionName"; + lblSectionName.Padding = new System.Windows.Forms.Padding(0, 2, 0, 0); + lblSectionName.Size = new System.Drawing.Size(656, 46); + lblSectionName.TabIndex = 26; + lblSectionName.Text = "Database Connection Manager"; // - // chkUseSQLServer + // pnlServerBlock // - chkUseSQLServer._mice = MrngCheckBox.MouseState.OUT; - chkUseSQLServer.AutoSize = true; - chkUseSQLServer.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkUseSQLServer.Location = new System.Drawing.Point(3, 3); - chkUseSQLServer.Name = "chkUseSQLServer"; - chkUseSQLServer.Size = new System.Drawing.Size(244, 17); - chkUseSQLServer.TabIndex = 2; - chkUseSQLServer.Text = "Use SQL Server to load && save connections"; - chkUseSQLServer.UseVisualStyleBackColor = true; - chkUseSQLServer.CheckedChanged += chkUseSQLServer_CheckedChanged; + pnlServerBlock.BackColor = System.Drawing.SystemColors.ControlLight; + pnlServerBlock.Controls.Add(tabCtrlSQL); + pnlServerBlock.Controls.Add(imgConnectionStatus); + pnlServerBlock.Controls.Add(lblTestConnectionResults); + pnlServerBlock.Controls.Add(btnTestConnection); + pnlServerBlock.Controls.Add(btnExpandOptions); + pnlServerBlock.Controls.Add(tableLayoutPanel1); + pnlServerBlock.Controls.Add(label1); + pnlServerBlock.Controls.Add(picboxLogo); + pnlServerBlock.Location = new System.Drawing.Point(15, 120); + pnlServerBlock.Name = "pnlServerBlock"; + pnlServerBlock.Size = new System.Drawing.Size(492, 324); + pnlServerBlock.TabIndex = 27; // - // lblSQLUsername + // tabCtrlSQL // - lblSQLUsername.Dock = System.Windows.Forms.DockStyle.Fill; - lblSQLUsername.Enabled = false; - lblSQLUsername.Location = new System.Drawing.Point(3, 78); - lblSQLUsername.Name = "lblSQLUsername"; - lblSQLUsername.Size = new System.Drawing.Size(154, 26); - lblSQLUsername.TabIndex = 7; - lblSQLUsername.Text = "Username:"; - lblSQLUsername.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + tabCtrlSQL.Controls.Add(tabPage1); + tabCtrlSQL.Controls.Add(tabPage2); + tabCtrlSQL.Controls.Add(tabPage3); + tabCtrlSQL.Controls.Add(tabPage4); + tabCtrlSQL.Location = new System.Drawing.Point(8, 3); + tabCtrlSQL.Name = "tabCtrlSQL"; + tabCtrlSQL.SelectedIndex = 0; + tabCtrlSQL.Size = new System.Drawing.Size(481, 277); + tabCtrlSQL.TabIndex = 33; + tabCtrlSQL.Visible = false; // - // txtSQLPassword + // tabPage1 // - txtSQLPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - txtSQLPassword.Dock = System.Windows.Forms.DockStyle.Fill; - txtSQLPassword.Enabled = false; - txtSQLPassword.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - txtSQLPassword.Location = new System.Drawing.Point(163, 107); - txtSQLPassword.Name = "txtSQLPassword"; - txtSQLPassword.Size = new System.Drawing.Size(235, 22); - txtSQLPassword.TabIndex = 10; - txtSQLPassword.UseSystemPasswordChar = true; + tabPage1.Controls.Add(pnlSQLCon); + tabPage1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + tabPage1.Location = new System.Drawing.Point(4, 22); + tabPage1.Name = "tabPage1"; + tabPage1.Padding = new System.Windows.Forms.Padding(3); + tabPage1.Size = new System.Drawing.Size(473, 251); + tabPage1.TabIndex = 0; + tabPage1.Text = "Server & Credentials"; + tabPage1.UseVisualStyleBackColor = true; // - // lblSQLServer + // pnlSQLCon // - lblSQLServer.Dock = System.Windows.Forms.DockStyle.Fill; - lblSQLServer.Enabled = false; - lblSQLServer.Location = new System.Drawing.Point(3, 26); - lblSQLServer.Name = "lblSQLServer"; - lblSQLServer.Size = new System.Drawing.Size(154, 26); - lblSQLServer.TabIndex = 3; - lblSQLServer.Text = "SQL Server:"; - lblSQLServer.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + pnlSQLCon.ColumnCount = 2; + pnlSQLCon.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); + pnlSQLCon.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + pnlSQLCon.Controls.Add(txtSQLAuthType, 1, 3); + pnlSQLCon.Controls.Add(lblSQLAuthType, 0, 3); + pnlSQLCon.Controls.Add(lblSQLReadOnly, 0, 7); + pnlSQLCon.Controls.Add(lblSQLType, 0, 0); + pnlSQLCon.Controls.Add(txtSQLType, 1, 0); + pnlSQLCon.Controls.Add(lblSQLServer, 0, 1); + pnlSQLCon.Controls.Add(chkSQLReadOnly, 1, 7); + pnlSQLCon.Controls.Add(lblSQLUsername, 0, 4); + pnlSQLCon.Controls.Add(lblSQLPassword, 0, 5); + pnlSQLCon.Controls.Add(txtSQLServer, 1, 1); + pnlSQLCon.Controls.Add(txtSQLPassword, 1, 5); + pnlSQLCon.Controls.Add(txtSQLUsername, 1, 4); + pnlSQLCon.Location = new System.Drawing.Point(-3, 9); + pnlSQLCon.Name = "pnlSQLCon"; + pnlSQLCon.RowCount = 8; + pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + pnlSQLCon.Size = new System.Drawing.Size(458, 223); + pnlSQLCon.TabIndex = 23; // - // txtSQLUsername + // txtSQLAuthType // - txtSQLUsername.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - txtSQLUsername.Dock = System.Windows.Forms.DockStyle.Fill; - txtSQLUsername.Enabled = false; - txtSQLUsername.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - txtSQLUsername.Location = new System.Drawing.Point(163, 81); - txtSQLUsername.Name = "txtSQLUsername"; - txtSQLUsername.Size = new System.Drawing.Size(235, 22); - txtSQLUsername.TabIndex = 8; + txtSQLAuthType._mice = MrngComboBox.MouseState.HOVER; + txtSQLAuthType.Dock = System.Windows.Forms.DockStyle.Fill; + txtSQLAuthType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + txtSQLAuthType.FormattingEnabled = true; + txtSQLAuthType.Items.AddRange(new object[] { "Windows Authentication", "SQL Server Authentication", "Microsoft Entra MFA", "Microsoft Entra Password", "Microsoft Entra Integrated", "Microsoft Entra Service Principal", "Microsoft Entra Managed Identity", "Microsoft Entra Default" }); + txtSQLAuthType.Location = new System.Drawing.Point(163, 81); + txtSQLAuthType.Name = "txtSQLAuthType"; + txtSQLAuthType.Size = new System.Drawing.Size(292, 21); + txtSQLAuthType.TabIndex = 24; + txtSQLAuthType.SelectedIndexChanged += txtSQLAuthType_SelectedIndexChanged; // - // txtSQLServer + // lblSQLAuthType // - txtSQLServer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - txtSQLServer.Dock = System.Windows.Forms.DockStyle.Fill; - txtSQLServer.Enabled = false; - txtSQLServer.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - txtSQLServer.Location = new System.Drawing.Point(163, 29); - txtSQLServer.Name = "txtSQLServer"; - txtSQLServer.Size = new System.Drawing.Size(235, 22); - txtSQLServer.TabIndex = 4; - // - // lblSQLPassword - // - lblSQLPassword.Dock = System.Windows.Forms.DockStyle.Fill; - lblSQLPassword.Enabled = false; - lblSQLPassword.Location = new System.Drawing.Point(3, 104); - lblSQLPassword.Name = "lblSQLPassword"; - lblSQLPassword.Size = new System.Drawing.Size(154, 26); - lblSQLPassword.TabIndex = 9; - lblSQLPassword.Text = "Password:"; - lblSQLPassword.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // btnTestConnection - // - btnTestConnection._mice = MrngButton.MouseState.OUT; - btnTestConnection.Enabled = false; - btnTestConnection.Location = new System.Drawing.Point(3, 194); - btnTestConnection.Name = "btnTestConnection"; - btnTestConnection.Size = new System.Drawing.Size(153, 25); - btnTestConnection.TabIndex = 11; - btnTestConnection.Text = "Test Connection"; - btnTestConnection.UseVisualStyleBackColor = true; - btnTestConnection.Click += btnTestConnection_Click; - // - // imgConnectionStatus - // - imgConnectionStatus.Image = Properties.Resources.F1Help_16x; - imgConnectionStatus.Location = new System.Drawing.Point(163, 199); - imgConnectionStatus.Name = "imgConnectionStatus"; - imgConnectionStatus.Size = new System.Drawing.Size(16, 16); - imgConnectionStatus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - imgConnectionStatus.TabIndex = 12; - imgConnectionStatus.TabStop = false; - // - // lblTestConnectionResults - // - lblTestConnectionResults.AutoSize = true; - lblTestConnectionResults.Location = new System.Drawing.Point(3, 222); - lblTestConnectionResults.Name = "lblTestConnectionResults"; - lblTestConnectionResults.Size = new System.Drawing.Size(125, 13); - lblTestConnectionResults.TabIndex = 13; - lblTestConnectionResults.Text = "Test connection details"; - // - // chkSQLReadOnly - // - chkSQLReadOnly._mice = MrngCheckBox.MouseState.OUT; - chkSQLReadOnly.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; - chkSQLReadOnly.AutoSize = true; - chkSQLReadOnly.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - chkSQLReadOnly.Location = new System.Drawing.Point(163, 133); - chkSQLReadOnly.Name = "chkSQLReadOnly"; - chkSQLReadOnly.Size = new System.Drawing.Size(15, 20); - chkSQLReadOnly.TabIndex = 14; - chkSQLReadOnly.UseVisualStyleBackColor = true; + lblSQLAuthType.Dock = System.Windows.Forms.DockStyle.Fill; + lblSQLAuthType.Location = new System.Drawing.Point(3, 78); + lblSQLAuthType.Name = "lblSQLAuthType"; + lblSQLAuthType.Size = new System.Drawing.Size(154, 26); + lblSQLAuthType.TabIndex = 23; + lblSQLAuthType.Text = "Autentifcation:"; + lblSQLAuthType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // lblSQLReadOnly // lblSQLReadOnly.Dock = System.Windows.Forms.DockStyle.Fill; lblSQLReadOnly.Enabled = false; - lblSQLReadOnly.Location = new System.Drawing.Point(3, 130); + lblSQLReadOnly.Location = new System.Drawing.Point(3, 182); lblSQLReadOnly.Name = "lblSQLReadOnly"; - lblSQLReadOnly.Size = new System.Drawing.Size(154, 26); - lblSQLReadOnly.TabIndex = 15; - lblSQLReadOnly.Text = "Read Only:"; + lblSQLReadOnly.Size = new System.Drawing.Size(154, 41); + lblSQLReadOnly.TabIndex = 22; + lblSQLReadOnly.Text = "Access for Read Only:"; lblSQLReadOnly.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // lblSQLType // lblSQLType.Dock = System.Windows.Forms.DockStyle.Fill; - lblSQLType.Enabled = false; lblSQLType.Location = new System.Drawing.Point(3, 0); lblSQLType.Name = "lblSQLType"; lblSQLType.Size = new System.Drawing.Size(154, 26); lblSQLType.TabIndex = 20; - lblSQLType.Text = "SQL Server Type:"; + lblSQLType.Text = "Database Platform:"; lblSQLType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtSQLType @@ -216,106 +250,740 @@ namespace mRemoteNG.UI.Forms.OptionsPages txtSQLType._mice = MrngComboBox.MouseState.HOVER; txtSQLType.Dock = System.Windows.Forms.DockStyle.Fill; txtSQLType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - txtSQLType.Enabled = false; txtSQLType.FormattingEnabled = true; - txtSQLType.Items.AddRange(new object[] { "mssql", "mysql" }); + txtSQLType.Items.AddRange(new object[] { "MSSQL - developed by Microsoft", "MySQL - developed by Oracle" }); txtSQLType.Location = new System.Drawing.Point(163, 3); txtSQLType.Name = "txtSQLType"; - txtSQLType.Size = new System.Drawing.Size(235, 21); + txtSQLType.Size = new System.Drawing.Size(292, 21); txtSQLType.TabIndex = 21; // - // pnlSQLCon + // lblSQLServer // - pnlSQLCon.ColumnCount = 2; - pnlSQLCon.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); - pnlSQLCon.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - pnlSQLCon.Controls.Add(lblSQLType, 0, 0); - pnlSQLCon.Controls.Add(txtSQLType, 1, 0); - pnlSQLCon.Controls.Add(lblSQLServer, 0, 1); - pnlSQLCon.Controls.Add(chkSQLReadOnly, 1, 5); - pnlSQLCon.Controls.Add(lblSQLReadOnly, 0, 5); - pnlSQLCon.Controls.Add(lblSQLDatabaseName, 0, 2); - pnlSQLCon.Controls.Add(txtSQLDatabaseName, 1, 2); - pnlSQLCon.Controls.Add(lblSQLUsername, 0, 3); - pnlSQLCon.Controls.Add(lblSQLPassword, 0, 4); - pnlSQLCon.Controls.Add(txtSQLServer, 1, 1); - pnlSQLCon.Controls.Add(txtSQLPassword, 1, 4); - pnlSQLCon.Controls.Add(txtSQLUsername, 1, 3); - pnlSQLCon.Enabled = false; - pnlSQLCon.Location = new System.Drawing.Point(3, 26); - pnlSQLCon.Name = "pnlSQLCon"; - pnlSQLCon.RowCount = 7; - pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - pnlSQLCon.RowStyles.Add(new System.Windows.Forms.RowStyle()); - pnlSQLCon.Size = new System.Drawing.Size(401, 162); - pnlSQLCon.TabIndex = 22; + lblSQLServer.Dock = System.Windows.Forms.DockStyle.Fill; + lblSQLServer.Location = new System.Drawing.Point(3, 26); + lblSQLServer.Name = "lblSQLServer"; + lblSQLServer.Size = new System.Drawing.Size(154, 26); + lblSQLServer.TabIndex = 3; + lblSQLServer.Text = "Server name or IP:"; + lblSQLServer.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // pnlOptions + // chkSQLReadOnly // - pnlOptions.Controls.Add(chkUseSQLServer); - pnlOptions.Controls.Add(pnlSQLCon); - pnlOptions.Controls.Add(btnTestConnection); - pnlOptions.Controls.Add(lblTestConnectionResults); - pnlOptions.Controls.Add(imgConnectionStatus); - pnlOptions.Dock = System.Windows.Forms.DockStyle.Top; - pnlOptions.Location = new System.Drawing.Point(0, 30); - pnlOptions.Name = "pnlOptions"; - pnlOptions.Size = new System.Drawing.Size(610, 329); - pnlOptions.TabIndex = 23; + chkSQLReadOnly._mice = MrngCheckBox.MouseState.OUT; + chkSQLReadOnly.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + chkSQLReadOnly.AutoSize = true; + chkSQLReadOnly.Font = new System.Drawing.Font("Segoe UI", 8.25F); + chkSQLReadOnly.Location = new System.Drawing.Point(163, 185); + chkSQLReadOnly.Name = "chkSQLReadOnly"; + chkSQLReadOnly.Size = new System.Drawing.Size(15, 35); + chkSQLReadOnly.TabIndex = 14; + chkSQLReadOnly.UseVisualStyleBackColor = true; // - // lblRegistrySettingsUsedInfo + // lblSQLUsername // - lblRegistrySettingsUsedInfo.BackColor = System.Drawing.SystemColors.ControlLight; - lblRegistrySettingsUsedInfo.Dock = System.Windows.Forms.DockStyle.Top; - lblRegistrySettingsUsedInfo.ForeColor = System.Drawing.SystemColors.ControlText; - lblRegistrySettingsUsedInfo.Location = new System.Drawing.Point(0, 0); - lblRegistrySettingsUsedInfo.Name = "lblRegistrySettingsUsedInfo"; - lblRegistrySettingsUsedInfo.Padding = new System.Windows.Forms.Padding(0, 2, 0, 0); - lblRegistrySettingsUsedInfo.Size = new System.Drawing.Size(610, 30); - lblRegistrySettingsUsedInfo.TabIndex = 24; - lblRegistrySettingsUsedInfo.Text = "Some settings are configured by your Administrator. Please contact your administrator for more information."; - lblRegistrySettingsUsedInfo.Visible = false; + lblSQLUsername.Dock = System.Windows.Forms.DockStyle.Fill; + lblSQLUsername.Location = new System.Drawing.Point(3, 104); + lblSQLUsername.Name = "lblSQLUsername"; + lblSQLUsername.Size = new System.Drawing.Size(154, 26); + lblSQLUsername.TabIndex = 7; + lblSQLUsername.Text = "Username:"; + lblSQLUsername.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblSQLPassword + // + lblSQLPassword.Dock = System.Windows.Forms.DockStyle.Fill; + lblSQLPassword.Location = new System.Drawing.Point(3, 130); + lblSQLPassword.Name = "lblSQLPassword"; + lblSQLPassword.Size = new System.Drawing.Size(154, 26); + lblSQLPassword.TabIndex = 9; + lblSQLPassword.Text = "Password:"; + lblSQLPassword.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtSQLServer + // + txtSQLServer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + txtSQLServer.Dock = System.Windows.Forms.DockStyle.Fill; + txtSQLServer.Font = new System.Drawing.Font("Segoe UI", 8.25F); + txtSQLServer.Location = new System.Drawing.Point(163, 29); + txtSQLServer.Name = "txtSQLServer"; + txtSQLServer.Size = new System.Drawing.Size(292, 22); + txtSQLServer.TabIndex = 4; + // + // txtSQLPassword + // + txtSQLPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + txtSQLPassword.Dock = System.Windows.Forms.DockStyle.Fill; + txtSQLPassword.Font = new System.Drawing.Font("Segoe UI", 8.25F); + txtSQLPassword.Location = new System.Drawing.Point(163, 133); + txtSQLPassword.Name = "txtSQLPassword"; + txtSQLPassword.Size = new System.Drawing.Size(292, 22); + txtSQLPassword.TabIndex = 10; + txtSQLPassword.UseSystemPasswordChar = true; + // + // txtSQLUsername + // + txtSQLUsername.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + txtSQLUsername.Dock = System.Windows.Forms.DockStyle.Fill; + txtSQLUsername.Font = new System.Drawing.Font("Segoe UI", 8.25F); + txtSQLUsername.Location = new System.Drawing.Point(163, 107); + txtSQLUsername.Name = "txtSQLUsername"; + txtSQLUsername.Size = new System.Drawing.Size(292, 22); + txtSQLUsername.TabIndex = 8; + // + // tabPage2 + // + tabPage2.Controls.Add(tableLayoutPanel2); + tabPage2.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + tabPage2.Location = new System.Drawing.Point(4, 22); + tabPage2.Name = "tabPage2"; + tabPage2.Padding = new System.Windows.Forms.Padding(3); + tabPage2.Size = new System.Drawing.Size(473, 251); + tabPage2.TabIndex = 1; + tabPage2.Text = "Connection Properties"; + tabPage2.UseVisualStyleBackColor = true; + // + // tableLayoutPanel2 + // + tableLayoutPanel2.ColumnCount = 2; + tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); + tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + tableLayoutPanel2.Controls.Add(txtSQLDatabaseName, 1, 0); + tableLayoutPanel2.Controls.Add(lblSQLDatabaseName, 0, 0); + tableLayoutPanel2.Controls.Add(numericUpDown3, 1, 4); + tableLayoutPanel2.Controls.Add(numericUpDown2, 1, 3); + tableLayoutPanel2.Controls.Add(mrngLabel19, 0, 2); + tableLayoutPanel2.Controls.Add(mrngComboBox4, 1, 1); + tableLayoutPanel2.Controls.Add(mrngLabel18, 0, 1); + tableLayoutPanel2.Controls.Add(mrngLabel1, 0, 3); + tableLayoutPanel2.Controls.Add(mrngLabel9, 0, 4); + tableLayoutPanel2.Controls.Add(numericUpDown1, 1, 2); + tableLayoutPanel2.Location = new System.Drawing.Point(-3, 9); + tableLayoutPanel2.Name = "tableLayoutPanel2"; + tableLayoutPanel2.RowCount = 6; + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + tableLayoutPanel2.Size = new System.Drawing.Size(458, 191); + tableLayoutPanel2.TabIndex = 23; + // + // txtSQLDatabaseName + // + txtSQLDatabaseName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + txtSQLDatabaseName.Dock = System.Windows.Forms.DockStyle.Fill; + txtSQLDatabaseName.Font = new System.Drawing.Font("Segoe UI", 8.25F); + txtSQLDatabaseName.Location = new System.Drawing.Point(163, 3); + txtSQLDatabaseName.Name = "txtSQLDatabaseName"; + txtSQLDatabaseName.Size = new System.Drawing.Size(292, 22); + txtSQLDatabaseName.TabIndex = 32; + // + // lblSQLDatabaseName + // + lblSQLDatabaseName.Dock = System.Windows.Forms.DockStyle.Fill; + lblSQLDatabaseName.Location = new System.Drawing.Point(3, 0); + lblSQLDatabaseName.Name = "lblSQLDatabaseName"; + lblSQLDatabaseName.Size = new System.Drawing.Size(154, 26); + lblSQLDatabaseName.TabIndex = 31; + lblSQLDatabaseName.Text = "Database name:"; + lblSQLDatabaseName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // numericUpDown3 + // + numericUpDown3.Location = new System.Drawing.Point(163, 107); + numericUpDown3.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 }); + numericUpDown3.Name = "numericUpDown3"; + numericUpDown3.Size = new System.Drawing.Size(120, 22); + numericUpDown3.TabIndex = 30; + // + // numericUpDown2 + // + numericUpDown2.Location = new System.Drawing.Point(163, 81); + numericUpDown2.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 }); + numericUpDown2.Name = "numericUpDown2"; + numericUpDown2.Size = new System.Drawing.Size(120, 22); + numericUpDown2.TabIndex = 29; + numericUpDown2.Value = new decimal(new int[] { 30, 0, 0, 0 }); + // + // mrngLabel19 + // + mrngLabel19.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel19.Location = new System.Drawing.Point(3, 52); + mrngLabel19.Name = "mrngLabel19"; + mrngLabel19.Size = new System.Drawing.Size(154, 26); + mrngLabel19.TabIndex = 27; + mrngLabel19.Text = "Network packet size (bytes):"; + mrngLabel19.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngComboBox4 + // + mrngComboBox4._mice = MrngComboBox.MouseState.HOVER; + mrngComboBox4.Dock = System.Windows.Forms.DockStyle.Fill; + mrngComboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + mrngComboBox4.FormattingEnabled = true; + mrngComboBox4.Items.AddRange(new object[] { "", "Named Pipes", "Shared Memory", "TCP/IP" }); + mrngComboBox4.Location = new System.Drawing.Point(163, 29); + mrngComboBox4.Name = "mrngComboBox4"; + mrngComboBox4.Size = new System.Drawing.Size(292, 21); + mrngComboBox4.TabIndex = 26; + // + // mrngLabel18 + // + mrngLabel18.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel18.Location = new System.Drawing.Point(3, 26); + mrngLabel18.Name = "mrngLabel18"; + mrngLabel18.Size = new System.Drawing.Size(154, 26); + mrngLabel18.TabIndex = 25; + mrngLabel18.Text = "Network protocol:"; + mrngLabel18.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngLabel1 + // + mrngLabel1.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel1.Location = new System.Drawing.Point(3, 78); + mrngLabel1.Name = "mrngLabel1"; + mrngLabel1.Size = new System.Drawing.Size(154, 26); + mrngLabel1.TabIndex = 23; + mrngLabel1.Text = "Connection time-out (s):"; + mrngLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngLabel9 + // + mrngLabel9.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel9.Location = new System.Drawing.Point(3, 104); + mrngLabel9.Name = "mrngLabel9"; + mrngLabel9.Size = new System.Drawing.Size(154, 26); + mrngLabel9.TabIndex = 7; + mrngLabel9.Text = "Execution time-out (s):"; + mrngLabel9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // numericUpDown1 + // + numericUpDown1.Location = new System.Drawing.Point(163, 55); + numericUpDown1.Maximum = new decimal(new int[] { 10000000, 0, 0, 0 }); + numericUpDown1.Name = "numericUpDown1"; + numericUpDown1.Size = new System.Drawing.Size(120, 22); + numericUpDown1.TabIndex = 28; + numericUpDown1.Value = new decimal(new int[] { 4096, 0, 0, 0 }); + // + // tabPage3 + // + tabPage3.Controls.Add(tableLayoutPanel3); + tabPage3.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + tabPage3.Location = new System.Drawing.Point(4, 22); + tabPage3.Name = "tabPage3"; + tabPage3.Padding = new System.Windows.Forms.Padding(3); + tabPage3.Size = new System.Drawing.Size(473, 251); + tabPage3.TabIndex = 2; + tabPage3.Text = "Security"; + tabPage3.UseVisualStyleBackColor = true; + // + // tableLayoutPanel3 + // + tableLayoutPanel3.ColumnCount = 2; + tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); + tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + tableLayoutPanel3.Controls.Add(mrngCheckBox5, 1, 8); + tableLayoutPanel3.Controls.Add(mrngLabel7, 0, 8); + tableLayoutPanel3.Controls.Add(mrngTextBox5, 1, 7); + tableLayoutPanel3.Controls.Add(mrngLabel3, 0, 7); + tableLayoutPanel3.Controls.Add(mrngComboBox2, 1, 6); + tableLayoutPanel3.Controls.Add(mrngCheckBox2, 1, 5); + tableLayoutPanel3.Controls.Add(mrngCheckBox4, 1, 1); + tableLayoutPanel3.Controls.Add(mrngCheckBox3, 1, 0); + tableLayoutPanel3.Controls.Add(mrngComboBox3, 1, 3); + tableLayoutPanel3.Controls.Add(mrngLabel11, 0, 3); + tableLayoutPanel3.Controls.Add(mrngLabel12, 0, 6); + tableLayoutPanel3.Controls.Add(mrngLabel13, 0, 0); + tableLayoutPanel3.Controls.Add(mrngLabel14, 0, 1); + tableLayoutPanel3.Controls.Add(mrngLabel15, 0, 2); + tableLayoutPanel3.Controls.Add(mrngTextBox8, 1, 2); + tableLayoutPanel3.Controls.Add(mrngLabel16, 0, 4); + tableLayoutPanel3.Controls.Add(mrngLabel17, 0, 5); + tableLayoutPanel3.Controls.Add(mrngTextBox11, 1, 4); + tableLayoutPanel3.Location = new System.Drawing.Point(-3, 9); + tableLayoutPanel3.Name = "tableLayoutPanel3"; + tableLayoutPanel3.RowCount = 10; + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel3.Size = new System.Drawing.Size(458, 233); + tableLayoutPanel3.TabIndex = 23; + // + // mrngCheckBox5 + // + mrngCheckBox5._mice = MrngCheckBox.MouseState.OUT; + mrngCheckBox5.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + mrngCheckBox5.AutoSize = true; + mrngCheckBox5.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngCheckBox5.Location = new System.Drawing.Point(163, 211); + mrngCheckBox5.Name = "mrngCheckBox5"; + mrngCheckBox5.Size = new System.Drawing.Size(15, 20); + mrngCheckBox5.TabIndex = 33; + mrngCheckBox5.UseVisualStyleBackColor = true; + // + // mrngLabel7 + // + mrngLabel7.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel7.Location = new System.Drawing.Point(3, 208); + mrngLabel7.Name = "mrngLabel7"; + mrngLabel7.Size = new System.Drawing.Size(154, 26); + mrngLabel7.TabIndex = 32; + mrngLabel7.Text = "Trust server certificate:"; + mrngLabel7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngTextBox5 + // + mrngTextBox5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + mrngTextBox5.Dock = System.Windows.Forms.DockStyle.Fill; + mrngTextBox5.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngTextBox5.Location = new System.Drawing.Point(163, 185); + mrngTextBox5.Name = "mrngTextBox5"; + mrngTextBox5.Size = new System.Drawing.Size(292, 22); + mrngTextBox5.TabIndex = 31; + // + // mrngLabel3 + // + mrngLabel3.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel3.Location = new System.Drawing.Point(3, 182); + mrngLabel3.Name = "mrngLabel3"; + mrngLabel3.Size = new System.Drawing.Size(154, 26); + mrngLabel3.TabIndex = 30; + mrngLabel3.Text = "Host name in certificate:"; + mrngLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngComboBox2 + // + mrngComboBox2._mice = MrngComboBox.MouseState.HOVER; + mrngComboBox2.Dock = System.Windows.Forms.DockStyle.Fill; + mrngComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + mrngComboBox2.FormattingEnabled = true; + mrngComboBox2.Items.AddRange(new object[] { "Optional", "Mandatory", "Strict (SQL Server 2022 and Azure SQL)" }); + mrngComboBox2.Location = new System.Drawing.Point(163, 159); + mrngComboBox2.Name = "mrngComboBox2"; + mrngComboBox2.Size = new System.Drawing.Size(292, 21); + mrngComboBox2.TabIndex = 29; + // + // mrngCheckBox2 + // + mrngCheckBox2._mice = MrngCheckBox.MouseState.OUT; + mrngCheckBox2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + mrngCheckBox2.AutoSize = true; + mrngCheckBox2.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngCheckBox2.Location = new System.Drawing.Point(163, 133); + mrngCheckBox2.Name = "mrngCheckBox2"; + mrngCheckBox2.Size = new System.Drawing.Size(15, 20); + mrngCheckBox2.TabIndex = 27; + mrngCheckBox2.UseVisualStyleBackColor = true; + // + // mrngCheckBox4 + // + mrngCheckBox4._mice = MrngCheckBox.MouseState.OUT; + mrngCheckBox4.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + mrngCheckBox4.AutoSize = true; + mrngCheckBox4.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngCheckBox4.Location = new System.Drawing.Point(163, 29); + mrngCheckBox4.Name = "mrngCheckBox4"; + mrngCheckBox4.Size = new System.Drawing.Size(15, 20); + mrngCheckBox4.TabIndex = 26; + mrngCheckBox4.UseVisualStyleBackColor = true; + // + // mrngCheckBox3 + // + mrngCheckBox3._mice = MrngCheckBox.MouseState.OUT; + mrngCheckBox3.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + mrngCheckBox3.AutoSize = true; + mrngCheckBox3.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngCheckBox3.Location = new System.Drawing.Point(163, 3); + mrngCheckBox3.Name = "mrngCheckBox3"; + mrngCheckBox3.Size = new System.Drawing.Size(15, 20); + mrngCheckBox3.TabIndex = 25; + mrngCheckBox3.UseVisualStyleBackColor = true; + // + // mrngComboBox3 + // + mrngComboBox3._mice = MrngComboBox.MouseState.HOVER; + mrngComboBox3.Dock = System.Windows.Forms.DockStyle.Fill; + mrngComboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + mrngComboBox3.FormattingEnabled = true; + mrngComboBox3.Items.AddRange(new object[] { "None", "Host Guardian Service", "Microsoft Azure Attestation" }); + mrngComboBox3.Location = new System.Drawing.Point(163, 81); + mrngComboBox3.Name = "mrngComboBox3"; + mrngComboBox3.Size = new System.Drawing.Size(292, 21); + mrngComboBox3.TabIndex = 24; + // + // mrngLabel11 + // + mrngLabel11.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel11.Location = new System.Drawing.Point(3, 78); + mrngLabel11.Name = "mrngLabel11"; + mrngLabel11.Size = new System.Drawing.Size(154, 26); + mrngLabel11.TabIndex = 23; + mrngLabel11.Text = "Protocol:"; + mrngLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngLabel12 + // + mrngLabel12.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel12.Location = new System.Drawing.Point(3, 156); + mrngLabel12.Name = "mrngLabel12"; + mrngLabel12.Size = new System.Drawing.Size(154, 26); + mrngLabel12.TabIndex = 22; + mrngLabel12.Text = "Encryption:"; + mrngLabel12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngLabel13 + // + mrngLabel13.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel13.Location = new System.Drawing.Point(3, 0); + mrngLabel13.Name = "mrngLabel13"; + mrngLabel13.Size = new System.Drawing.Size(154, 26); + mrngLabel13.TabIndex = 20; + mrngLabel13.Text = "Enable Always Encrypted:"; + mrngLabel13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngLabel14 + // + mrngLabel14.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel14.Location = new System.Drawing.Point(3, 26); + mrngLabel14.Name = "mrngLabel14"; + mrngLabel14.Size = new System.Drawing.Size(154, 26); + mrngLabel14.TabIndex = 3; + mrngLabel14.Text = "Enable secure enclaves:"; + mrngLabel14.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngLabel15 + // + mrngLabel15.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel15.Location = new System.Drawing.Point(3, 52); + mrngLabel15.Name = "mrngLabel15"; + mrngLabel15.Size = new System.Drawing.Size(154, 26); + mrngLabel15.TabIndex = 5; + mrngLabel15.Text = "Enclave attestation:"; + mrngLabel15.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngTextBox8 + // + mrngTextBox8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + mrngTextBox8.Dock = System.Windows.Forms.DockStyle.Fill; + mrngTextBox8.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngTextBox8.Location = new System.Drawing.Point(163, 55); + mrngTextBox8.Name = "mrngTextBox8"; + mrngTextBox8.Size = new System.Drawing.Size(292, 22); + mrngTextBox8.TabIndex = 6; + // + // mrngLabel16 + // + mrngLabel16.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel16.Location = new System.Drawing.Point(3, 104); + mrngLabel16.Name = "mrngLabel16"; + mrngLabel16.Size = new System.Drawing.Size(154, 26); + mrngLabel16.TabIndex = 7; + mrngLabel16.Text = "URL:"; + mrngLabel16.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngLabel17 + // + mrngLabel17.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel17.Location = new System.Drawing.Point(3, 130); + mrngLabel17.Name = "mrngLabel17"; + mrngLabel17.Size = new System.Drawing.Size(154, 26); + mrngLabel17.TabIndex = 9; + mrngLabel17.Text = "Enable MARS:"; + mrngLabel17.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngTextBox11 + // + mrngTextBox11.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + mrngTextBox11.Dock = System.Windows.Forms.DockStyle.Fill; + mrngTextBox11.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngTextBox11.Location = new System.Drawing.Point(163, 107); + mrngTextBox11.Name = "mrngTextBox11"; + mrngTextBox11.Size = new System.Drawing.Size(292, 22); + mrngTextBox11.TabIndex = 8; + // + // tabPage4 + // + tabPage4.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0); + tabPage4.Location = new System.Drawing.Point(4, 22); + tabPage4.Name = "tabPage4"; + tabPage4.Padding = new System.Windows.Forms.Padding(3); + tabPage4.Size = new System.Drawing.Size(473, 251); + tabPage4.TabIndex = 3; + tabPage4.Text = "Setup"; + tabPage4.UseVisualStyleBackColor = true; + // + // imgConnectionStatus + // + imgConnectionStatus.Image = Properties.Resources.F1Help_16x; + imgConnectionStatus.Location = new System.Drawing.Point(243, 286); + imgConnectionStatus.Name = "imgConnectionStatus"; + imgConnectionStatus.Size = new System.Drawing.Size(16, 16); + imgConnectionStatus.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + imgConnectionStatus.TabIndex = 32; + imgConnectionStatus.TabStop = false; + // + // lblTestConnectionResults + // + lblTestConnectionResults.AutoSize = true; + lblTestConnectionResults.Location = new System.Drawing.Point(17, 289); + lblTestConnectionResults.Name = "lblTestConnectionResults"; + lblTestConnectionResults.Size = new System.Drawing.Size(124, 13); + lblTestConnectionResults.TabIndex = 31; + lblTestConnectionResults.Text = "Test connection details"; + // + // btnTestConnection + // + btnTestConnection._mice = MrngButton.MouseState.OUT; + btnTestConnection.Location = new System.Drawing.Point(265, 286); + btnTestConnection.Name = "btnTestConnection"; + btnTestConnection.Size = new System.Drawing.Size(109, 25); + btnTestConnection.TabIndex = 30; + btnTestConnection.Text = "Test Connection"; + btnTestConnection.UseVisualStyleBackColor = true; + // + // btnExpandOptions + // + btnExpandOptions._mice = MrngButton.MouseState.OUT; + btnExpandOptions.Location = new System.Drawing.Point(380, 286); + btnExpandOptions.Name = "btnExpandOptions"; + btnExpandOptions.Size = new System.Drawing.Size(109, 25); + btnExpandOptions.TabIndex = 29; + btnExpandOptions.Text = "Advanced >>"; + btnExpandOptions.UseVisualStyleBackColor = true; + btnExpandOptions.Click += btnExpandOptions_Click; + // + // tableLayoutPanel1 + // + tableLayoutPanel1.ColumnCount = 2; + tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F)); + tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + tableLayoutPanel1.Controls.Add(mrngTextBox2, 1, 0); + tableLayoutPanel1.Controls.Add(mrngLabel4, 0, 0); + tableLayoutPanel1.Controls.Add(mrngLabel5, 0, 1); + tableLayoutPanel1.Controls.Add(mrngTextBox1, 1, 1); + tableLayoutPanel1.Controls.Add(mrngLabel6, 0, 2); + tableLayoutPanel1.Controls.Add(mrngTextBox4, 1, 2); + tableLayoutPanel1.Enabled = false; + tableLayoutPanel1.Location = new System.Drawing.Point(17, 148); + tableLayoutPanel1.Name = "tableLayoutPanel1"; + tableLayoutPanel1.RowCount = 4; + tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + tableLayoutPanel1.Size = new System.Drawing.Size(458, 81); + tableLayoutPanel1.TabIndex = 28; + // + // mrngTextBox2 + // + mrngTextBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + mrngTextBox2.Dock = System.Windows.Forms.DockStyle.Fill; + mrngTextBox2.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngTextBox2.Location = new System.Drawing.Point(163, 3); + mrngTextBox2.Name = "mrngTextBox2"; + mrngTextBox2.Size = new System.Drawing.Size(292, 22); + mrngTextBox2.TabIndex = 24; + // + // mrngLabel4 + // + mrngLabel4.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel4.Location = new System.Drawing.Point(3, 0); + mrngLabel4.Name = "mrngLabel4"; + mrngLabel4.Size = new System.Drawing.Size(154, 26); + mrngLabel4.TabIndex = 23; + mrngLabel4.Text = "Server name or IP:"; + mrngLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngLabel5 + // + mrngLabel5.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel5.Location = new System.Drawing.Point(3, 26); + mrngLabel5.Name = "mrngLabel5"; + mrngLabel5.Size = new System.Drawing.Size(154, 26); + mrngLabel5.TabIndex = 5; + mrngLabel5.Text = "Database name:"; + mrngLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngTextBox1 + // + mrngTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + mrngTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; + mrngTextBox1.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngTextBox1.Location = new System.Drawing.Point(163, 29); + mrngTextBox1.Name = "mrngTextBox1"; + mrngTextBox1.Size = new System.Drawing.Size(292, 22); + mrngTextBox1.TabIndex = 6; + // + // mrngLabel6 + // + mrngLabel6.Dock = System.Windows.Forms.DockStyle.Fill; + mrngLabel6.Location = new System.Drawing.Point(3, 52); + mrngLabel6.Name = "mrngLabel6"; + mrngLabel6.Size = new System.Drawing.Size(154, 26); + mrngLabel6.TabIndex = 7; + mrngLabel6.Text = "Username:"; + mrngLabel6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // mrngTextBox4 + // + mrngTextBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + mrngTextBox4.Dock = System.Windows.Forms.DockStyle.Fill; + mrngTextBox4.Font = new System.Drawing.Font("Segoe UI", 8.25F); + mrngTextBox4.Location = new System.Drawing.Point(163, 55); + mrngTextBox4.Name = "mrngTextBox4"; + mrngTextBox4.Size = new System.Drawing.Size(292, 22); + mrngTextBox4.TabIndex = 8; + // + // label1 + // + label1.Anchor = System.Windows.Forms.AnchorStyles.None; + label1.BackColor = System.Drawing.SystemColors.ControlLight; + label1.Font = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204); + label1.ForeColor = System.Drawing.SystemColors.ControlText; + label1.Location = new System.Drawing.Point(163, 69); + label1.Margin = new System.Windows.Forms.Padding(10, 10, 3, 0); + label1.Name = "label1"; + label1.Padding = new System.Windows.Forms.Padding(0, 2, 0, 0); + label1.Size = new System.Drawing.Size(275, 46); + label1.TabIndex = 27; + label1.Text = "Our Prod DB"; + label1.Visible = false; + // + // picboxLogo + // + picboxLogo.BackColor = System.Drawing.SystemColors.Control; + picboxLogo.Image = (System.Drawing.Image)resources.GetObject("picboxLogo.Image"); + picboxLogo.Location = new System.Drawing.Point(47, 39); + picboxLogo.Margin = new System.Windows.Forms.Padding(10); + picboxLogo.Name = "picboxLogo"; + picboxLogo.Padding = new System.Windows.Forms.Padding(5); + picboxLogo.Size = new System.Drawing.Size(94, 76); + picboxLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + picboxLogo.TabIndex = 0; + picboxLogo.TabStop = false; + // + // chkUseSQLServer + // + chkUseSQLServer.AutoSize = true; + chkUseSQLServer.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 204); + chkUseSQLServer.Location = new System.Drawing.Point(15, 89); + chkUseSQLServer.Name = "chkUseSQLServer"; + chkUseSQLServer.Size = new System.Drawing.Size(240, 25); + chkUseSQLServer.TabIndex = 34; + chkUseSQLServer.Text = "Enable SQL Server Integration:"; + chkUseSQLServer.UseVisualStyleBackColor = true; + chkUseSQLServer.CheckedChanged += chkUseSQLServer_CheckedChanged; // // SqlServerPage // AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - Controls.Add(pnlOptions); + Controls.Add(chkUseSQLServer); + Controls.Add(pnlServerBlock); + Controls.Add(lblSectionName); Controls.Add(lblRegistrySettingsUsedInfo); Margin = new System.Windows.Forms.Padding(4); Name = "SqlServerPage"; - Size = new System.Drawing.Size(610, 490); - ((System.ComponentModel.ISupportInitialize)imgConnectionStatus).EndInit(); + Size = new System.Drawing.Size(656, 490); + pnlServerBlock.ResumeLayout(false); + pnlServerBlock.PerformLayout(); + tabCtrlSQL.ResumeLayout(false); + tabPage1.ResumeLayout(false); pnlSQLCon.ResumeLayout(false); pnlSQLCon.PerformLayout(); - pnlOptions.ResumeLayout(false); - pnlOptions.PerformLayout(); + tabPage2.ResumeLayout(false); + tableLayoutPanel2.ResumeLayout(false); + tableLayoutPanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)numericUpDown3).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDown2).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit(); + tabPage3.ResumeLayout(false); + tableLayoutPanel3.ResumeLayout(false); + tableLayoutPanel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)imgConnectionStatus).EndInit(); + tableLayoutPanel1.ResumeLayout(false); + tableLayoutPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)picboxLogo).EndInit(); ResumeLayout(false); + PerformLayout(); } - - internal Controls.MrngLabel lblSQLDatabaseName; - internal Controls.MrngTextBox txtSQLDatabaseName; - internal MrngCheckBox chkUseSQLServer; - internal Controls.MrngLabel lblSQLUsername; - internal Controls.MrngTextBox txtSQLPassword; - internal Controls.MrngLabel lblSQLServer; - internal Controls.MrngTextBox txtSQLUsername; - internal Controls.MrngTextBox txtSQLServer; - internal Controls.MrngLabel lblSQLPassword; - private MrngButton btnTestConnection; - private System.Windows.Forms.PictureBox imgConnectionStatus; - private Controls.MrngLabel lblTestConnectionResults; - private MrngCheckBox chkSQLReadOnly; - internal Controls.MrngLabel lblSQLReadOnly; - internal Controls.MrngLabel lblSQLType; - private MrngComboBox txtSQLType; - private System.Windows.Forms.TableLayoutPanel pnlSQLCon; - private System.Windows.Forms.Panel pnlOptions; internal System.Windows.Forms.Label lblRegistrySettingsUsedInfo; + internal System.Windows.Forms.Label lblSectionName; + private System.Windows.Forms.Panel pnlServerBlock; + private System.Windows.Forms.PictureBox picboxLogo; + internal System.Windows.Forms.Label label1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + internal MrngLabel mrngLabel5; + internal MrngTextBox mrngTextBox1; + internal MrngLabel mrngLabel6; + internal MrngTextBox mrngTextBox4; + internal MrngTextBox mrngTextBox2; + internal MrngLabel mrngLabel4; + private MrngButton btnTestConnection; + private MrngButton btnExpandOptions; + private System.Windows.Forms.TabControl tabCtrlSQL; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TableLayoutPanel pnlSQLCon; + private MrngComboBox txtSQLAuthType; + internal MrngLabel lblSQLAuthType; + internal MrngLabel lblSQLType; + private MrngComboBox txtSQLType; + internal MrngLabel lblSQLServer; + private MrngCheckBox chkSQLReadOnly; + internal MrngLabel lblSQLUsername; + internal MrngLabel lblSQLPassword; + internal MrngTextBox txtSQLServer; + internal MrngTextBox txtSQLPassword; + internal MrngTextBox txtSQLUsername; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + internal MrngLabel mrngLabel1; + internal MrngLabel mrngLabel9; + private System.Windows.Forms.TabPage tabPage3; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private MrngComboBox mrngComboBox3; + internal MrngLabel mrngLabel11; + internal MrngLabel mrngLabel15; + internal MrngTextBox mrngTextBox8; + internal MrngLabel mrngLabel16; + internal MrngLabel mrngLabel17; + internal MrngTextBox mrngTextBox11; + private System.Windows.Forms.TabPage tabPage4; + private System.Windows.Forms.PictureBox imgConnectionStatus; + private MrngLabel lblTestConnectionResults; + internal MrngLabel mrngLabel13; + internal MrngLabel mrngLabel14; + private MrngCheckBox mrngCheckBox4; + private MrngCheckBox mrngCheckBox3; + private MrngComboBox mrngComboBox2; + private MrngCheckBox mrngCheckBox2; + internal MrngLabel mrngLabel12; + private MrngCheckBox mrngCheckBox5; + internal MrngLabel mrngLabel7; + internal MrngTextBox mrngTextBox5; + internal MrngLabel mrngLabel3; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox chkUseSQLServer; + internal MrngLabel mrngLabel19; + private MrngComboBox mrngComboBox4; + internal MrngLabel mrngLabel18; + private System.Windows.Forms.NumericUpDown numericUpDown3; + private System.Windows.Forms.NumericUpDown numericUpDown2; + private System.Windows.Forms.NumericUpDown numericUpDown1; + internal MrngTextBox txtSQLDatabaseName; + internal MrngLabel lblSQLDatabaseName; + internal MrngLabel lblSQLReadOnly; } } diff --git a/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.cs b/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.cs index 841260c90..098c91b37 100644 --- a/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.cs +++ b/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.cs @@ -40,7 +40,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages //lblSQLInfo.Text = Language.SQLInfo; chkUseSQLServer.Text = Language.UseSQLServer; - lblSQLServer.Text = Language.Hostname; + //lblSQLServer.Text = Language.Hostname; lblSQLDatabaseName.Text = Language.Database; lblSQLUsername.Text = Language.Username; lblSQLPassword.Text = Language.Password; @@ -152,22 +152,24 @@ namespace mRemoteNG.UI.Forms.OptionsPages private void toggleSQLPageControls(bool useSQLServer) { if (!chkUseSQLServer.Enabled) return; - - pnlSQLCon.Enabled = useSQLServer; - lblSQLType.Enabled = useSQLServer; - lblSQLServer.Enabled = useSQLServer; - lblSQLDatabaseName.Enabled = useSQLServer; - lblSQLUsername.Enabled = useSQLServer; - lblSQLPassword.Enabled = useSQLServer; - lblSQLReadOnly.Enabled = useSQLServer; - txtSQLType.Enabled = useSQLServer; - txtSQLServer.Enabled = useSQLServer; - txtSQLDatabaseName.Enabled = useSQLServer; - txtSQLUsername.Enabled = useSQLServer; - txtSQLPassword.Enabled = useSQLServer; - chkSQLReadOnly.Enabled = useSQLServer; + pnlServerBlock.Enabled = useSQLServer; btnTestConnection.Enabled = useSQLServer; + btnExpandOptions.Enabled = useSQLServer; + } + + private void btnExpandOptions_Click(object sender, EventArgs e) + { + if (btnExpandOptions.Text == "Advanced >>") + { + btnExpandOptions.Text = "<< Simple"; + tabCtrlSQL.Visible = true; } + else + { + btnExpandOptions.Text = "Advanced >>"; + tabCtrlSQL.Visible = false; + } + } private async void btnTestConnection_Click(object sender, EventArgs e) { @@ -181,11 +183,13 @@ namespace mRemoteNG.UI.Forms.OptionsPages imgConnectionStatus.Image = Properties.Resources.Loading_Spinner; btnTestConnection.Enabled = false; - ConnectionTestResult connectionTestResult = - await _databaseConnectionTester.TestConnectivity(type, server, database, username, password); + string connectionString = "Data Source=172.22.155.100,1433;Initial Catalog=Demo;User ID=sa;Password=London123"; + DatabaseConnectionTester.TestConnection(connectionString); + //ConnectionTestResult connectionTestResult = true + // await _databaseConnectionTester.TestConnectivity(type, server, database, username, password); btnTestConnection.Enabled = true; - + /* switch (connectionTestResult) { case ConnectionTestResult.ConnectionSucceded: @@ -216,6 +220,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages lblTestConnectionResults.Text = BuildTestFailedMessage(Language.RdpErrorUnknown); break; } + */ } private void UpdateConnectionImage(bool connectionSuccess) @@ -227,5 +232,94 @@ namespace mRemoteNG.UI.Forms.OptionsPages { return Language.ConnectionOpenFailed + Environment.NewLine + specificMessage; } + + private void txtSQLAuthType_SelectedIndexChanged(object sender, EventArgs e) + { + // Ensure SelectedItem is not null before accessing it + if (txtSQLAuthType.SelectedItem != null) + { + // Get the selected value + string? selectedValue = txtSQLAuthType.SelectedItem.ToString(); + + // Check the selected value and call appropriate action + if (selectedValue == "Windows Authentication") + { + lblSQLUsername.Text = "User name:"; + lblSQLUsername.Enabled = false; + txtSQLUsername.Enabled = false; + txtSQLUsername.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name; + lblSQLPassword.Visible = false; + txtSQLPassword.Visible = false; + } + else if (selectedValue == "SQL Server Authentication") + { + lblSQLUsername.Text = "login:"; + lblSQLUsername.Enabled = true; + txtSQLUsername.Enabled = true; + txtSQLUsername.Text = ""; + lblSQLPassword.Visible = true; + txtSQLPassword.Visible = true; + } + else if (selectedValue == "Microsoft Entra MFA") + { + lblSQLUsername.Text = "User name:"; + lblSQLUsername.Enabled = true; + txtSQLUsername.Enabled = true; + txtSQLUsername.Text = ""; + lblSQLPassword.Visible = false; + txtSQLPassword.Visible = false; + } + else if (selectedValue == "Microsoft Entra Password") + { + lblSQLUsername.Text = "User name:"; + lblSQLUsername.Enabled = true; + txtSQLUsername.Enabled = true; + txtSQLUsername.Text = ""; + lblSQLPassword.Visible = true; + txtSQLPassword.Visible = true; + } + else if (selectedValue == "Microsoft Entra Integrated") + { + lblSQLUsername.Text = "User name:"; + lblSQLUsername.Enabled = false; + txtSQLUsername.Enabled = false; + txtSQLUsername.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name; + lblSQLPassword.Visible = false; + txtSQLPassword.Visible = false; + } + else if (selectedValue == "Microsoft Entra Service Principal") + { + lblSQLUsername.Text = "User name:"; + lblSQLUsername.Enabled = true; + txtSQLUsername.Enabled = true; + txtSQLUsername.Text = ""; + lblSQLPassword.Visible = true; + txtSQLPassword.Visible = true; + } + else if (selectedValue == "Microsoft Entra Managed Identity") + { + lblSQLUsername.Text = "User assigned identity:"; + lblSQLUsername.Enabled = true; + txtSQLUsername.Enabled = true; + txtSQLUsername.Text = ""; + lblSQLPassword.Visible = false; + txtSQLPassword.Visible = false; + } + else if (selectedValue == "Microsoft Entra Default") + { + lblSQLUsername.Text = "User name:"; + lblSQLUsername.Enabled = true; + txtSQLUsername.Enabled = true; + txtSQLUsername.Text = ""; + lblSQLPassword.Visible = false; + txtSQLPassword.Visible = false; + } + else + { + // Handle other values or do nothing + Console.WriteLine("No matching option."); + } + } + } } } \ No newline at end of file diff --git a/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.resx b/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.resx index af32865ec..cd81a283c 100644 --- a/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.resx +++ b/mRemoteNG/UI/Forms/OptionsPages/SqlServerPage.resx @@ -1,7 +1,7 @@