Exemplo n.º 1
0
        /*
         * Init databases from the server
         */
        private void InitDatabases()
        {
            SQLManager manager = new SQLManager();
            string     sQuery  = "SELECT name, dbid FROM master..sysdatabases order by name";

            // handle errors
            //if (manager.GetQueryDataSet(sQuery) == null)
            //{
            //    HandleQueryError();
            //    return;
            //}

            DataSet objSet = manager.GetQueryDataSet(sQuery);

            DropDownListDatabases.DataSource     = objSet;
            DropDownListDatabases.DataTextField  = "name";
            DropDownListDatabases.DataValueField = "dbid";
            DropDownListDatabases.DataBind();
            manager.CloseConnection();
        }
Exemplo n.º 2
0
        /*
         * Init all table names into a listbox
         */
        private void InitTableNames()
        {
            // show DB tables
            SQLManager manager = new SQLManager(sSelectedDB);
            string     sQuery  = "Select name, id from sysobjects where xtype='U'";

            // handle errors
            //if (manager.GetQueryDataSet(sQuery) == null)
            //{
            //    HandleQueryError();
            //    return;
            //}

            DataSet objSet = manager.GetQueryDataSet(sQuery);

            ListBoxTables.DataSource     = objSet;
            ListBoxTables.DataTextField  = "name";
            ListBoxTables.DataValueField = "id";
            ListBoxTables.DataBind();
            manager.CloseConnection();
        }
Exemplo n.º 3
0
        /*
         * Init all table names into a listbox
         */
        private void InitTableNames()
        {
            // show DB tables
            SQLManager manager = new SQLManager(sSelectedDB);
            string sQuery = "Select name, id from sysobjects where xtype='U'";

            // handle errors
            //if (manager.GetQueryDataSet(sQuery) == null)
            //{
            //    HandleQueryError();
            //    return;
            //}

            DataSet objSet = manager.GetQueryDataSet(sQuery);
            ListBoxTables.DataSource = objSet;
            ListBoxTables.DataTextField = "name";
            ListBoxTables.DataValueField = "id";
            ListBoxTables.DataBind();
            manager.CloseConnection();
        }
Exemplo n.º 4
0
        /*
         * Init databases from the server
         */
        private void InitDatabases()
        {
            SQLManager manager = new SQLManager();
            string sQuery = "SELECT name, dbid FROM master..sysdatabases order by name";

            // handle errors
            //if (manager.GetQueryDataSet(sQuery) == null)
            //{
            //    HandleQueryError();
            //    return;
            //}

            DataSet objSet = manager.GetQueryDataSet(sQuery);
            DropDownListDatabases.DataSource = objSet;
            DropDownListDatabases.DataTextField = "name";
            DropDownListDatabases.DataValueField = "dbid";
            DropDownListDatabases.DataBind();
            manager.CloseConnection();
        }