Пример #1
0
        private void _btnEditConnection_Click(object sender, EventArgs e)
        {
            DataProviderDesc dpd = _cbDataProvider.SelectedItem as DataProviderDesc;
            DsgnDataLinkBase dl;

            if (dpd == null || dpd.Link == DsgnAutoLink.Instance)
            {
                // auto link can not be used for editing parameters
                // we should determine real type of connection string
                // and use needed Link class
                dl = DsgnAutoLink.Instance.GetRealLink(this);
            }
            else
            {
                dl = dpd.Link;
            }

            try
            {
                string connectionString = _cbConnectionString.Text;
                if (dl.EditConnection(this, ref connectionString))
                {
                    SetDataSource(dl.DataProvider, connectionString, RecordSource);
                }
            }
            catch (Exception ex)
            {
                DataSourceForm.ReportDataSourceError(string.Format(Strings.DataSourcePicker.ErrCannotEditConnFmt, ex.Message));
            }
            ActiveControl = _cbConnectionString;
        }
Пример #2
0
 public DataSourceFormState(DataSourceForm owner)
     : base(owner)
 {
 }