Ejemplo n.º 1
0
        void Connect_Action(object o, EventArgs args)
        {
            try {
                sqlSharp.dbProvider = null;
                sqlSharp.dbProvider = sqlSharp.providerList[providerSelected];
                string connection = "";

                connection = connection_entry.Text;

                sqlSharp.connectionString = connection;
                sqlSharp.OpenDataSource();
            } catch (Exception e) {
                sqlSharp.AppendText(sqlSharp.buf,
                                    "Error: Unable to connect.");
            }
            dialog.Destroy();
            dialog = null;
        }
Ejemplo n.º 2
0
        void Connect_Action(object o, EventArgs args)
        {
            try {
                SetStatusBarText("Connecting...");
                sqlSharp.OpenDataSource(providers[providerSelected], connection_entry.Text, selectedSetting);
                SetStatusBarText("Connected.");
            } catch (Exception e) {
                string emsg = "Error: Unable to connect.  Reason: " + e;
                SetStatusBarText(emsg);
                sqlSharp.AppendText(emsg);
            }

            grid.Clear();
            grid.DataSource = null;
            grid.DataMember = "";
            grid            = null;

            dialog.Destroy();
            dialog = null;
        }