Example #1
0
        public override NdoDialogResult ShowConnectionDialog(ref string connectionString)
        {
            string cs;

            if (connectionString != null)
            {
                cs = connectionString;
            }
            else
            {
                cs = string.Empty;
            }
            FbConnectionStringBuilder sb = new FbConnectionStringBuilder(cs);

            sb.Dialect = 3;
            if (cs == string.Empty)
            {
                sb.UserID     = "SYSDBA";
                sb.Password   = "******";
                sb.DataSource = "localhost";
                sb.Database   = string.Empty;
            }
            ConnectionDialog dlg = new ConnectionDialog(sb);

            if ((NdoDialogResult)dlg.ShowDialog() == NdoDialogResult.Cancel)
            {
                return(NdoDialogResult.Cancel);
            }
            connectionString = sb.ConnectionString;
            return(NdoDialogResult.OK);
        }
Example #2
0
        public override NdoDialogResult ShowCreateDbDialog(ref object necessaryData)
        {
            FbConnectionStringBuilder sb = necessaryData as FbConnectionStringBuilder;

            if (sb == null)
            {
                sb            = new FbConnectionStringBuilder();
                sb.UserID     = "SYSDBA";
                sb.Password   = "******";
                sb.DataSource = "localhost";
                sb.Database   = string.Empty;
            }
            sb.Dialect = 3;
            ConnectionDialog dlg = new ConnectionDialog(sb);

            dlg.CreateDatabase = true;
            NdoDialogResult result = (NdoDialogResult)dlg.ShowDialog();

            if (result == NdoDialogResult.Cancel)
            {
                return(result);
            }
            necessaryData = sb;
            return(result);
        }