private void buttonConnect_Click(object sender, EventArgs e) { AdsConnectionStringBuilder builder = new AdsConnectionStringBuilder(); builder.DataSource = textboxDataSource.Text; builder.ServerType = cbServerType.SelectedItem.ToString(); if (textboxUser.Text.Length > 0) { builder.UserID = textboxUser.Text; } if (textboxPassword.Text.Length > 0) { builder.Password = textboxPassword.Text; } ConnectionString = builder.ConnectionString; }
private void SetupConnection() { // Load up the configuration to allow access to the datasource aCsb = new AdsConnectionStringBuilder(); aCsb.DataSource = _strDataSource; aCsb.ServerType = "Remote"; aCsb.UserID = _strDataUsername; aCsb.Password = _strDataPassword; aCsb.TrimTrailingSpaces = true; aCsb.TableType = "CDX"; //aCsb.LockMode = "COMPATIBLE"; aCsb.ShowDeleted = false; // Create the Instance of the datasource dbInstance = new AdsConnection(); dbInstance.ConnectionString = aCsb.ToString(); }