예제 #1
0
        private void cmdLoadOleDb_Click(object sender, EventArgs e)
        {
            OpenFileDialog openOleDbFileDialog;

            openOleDbFileDialog            = new System.Windows.Forms.OpenFileDialog();
            openOleDbFileDialog.DefaultExt = "udl";
            openOleDbFileDialog.FileName   = "OleDb";
            openOleDbFileDialog.Filter     = "OleDB Connection String (*.udl;*.connectString)|*.udl;*.connectString|Text File(*" +
                                             ".txt)|*.txt|All Files (*.*)|*.*";

            if (openOleDbFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string data = OleDbBrowser.GetConnectString(openOleDbFileDialog.FileName);
                    if ((data != null) && (data != string.Empty))
                    {
                        txtOleDbConnectionString.Text = data;
                        cmdConnect.Focus();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error opening file", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
예제 #2
0
        public IBrowser Clone(DbClient newDbClient)
        {
            OleDbBrowser sb = new OleDbBrowser(newDbClient);

            return(sb);
        }