示例#1
0
 public void LoadQuery(IDataQueryUser owner)
 {
     _owner   = owner;
     _easyQry = new EasyQuery();
     _easyQry.ConnectionID        = _owner.ConnectionID;
     _easyQry.ForReadOnly         = true;
     _easyQry.SQL                 = new SQLStatement(_owner.SqlString);
     _easyQry.Description         = "Database lookup";
     _easyQry.SqlChanged         += new EventHandler(_easyQry_SqlChanged);
     propertyGrid1.SelectedObject = _easyQry;
     _easyQry.SetLoaded();
 }
        public void loadData()
        {
            const string TABLENAME = "Links";
            //
            WebDataEditorLookupDB wd = WebLookup;

            //
            ds.Tables.Clear();
            ds.Tables.Add(TABLENAME);
            //
            ds.Tables[0].Columns.Add();
            ds.Tables[0].Columns.Add();
            //
            ds.Tables[0].Columns[0].Caption    = "Fields to be Updated";
            ds.Tables[0].Columns[0].ColumnName = "Destination";
            ds.Tables[0].Columns[0].DataType   = typeof(string);
            ds.Tables[0].Columns[0].MaxLength  = 120;
            ds.Tables[0].Columns[0].ReadOnly   = true;
            //
            ds.Tables[0].Columns[1].Caption    = "Source Fields";
            ds.Tables[0].Columns[1].ColumnName = "Source";
            ds.Tables[0].Columns[1].DataType   = typeof(string);
            ds.Tables[0].Columns[1].MaxLength  = 120;
            //
            //
            dataGridView1.DataSource              = ds;
            dataGridView1.DataMember              = TABLENAME;
            dataGridView1.ReadOnly                = true;
            dataGridView1.AllowUserToAddRows      = false;
            dataGridView1.AllowUserToDeleteRows   = false;
            dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            //
            cbx2         = new System.Windows.Forms.ComboBox();
            cbx2.Parent  = dataGridView1;
            cbx2.Visible = false;
            cbx2.Left    = 0;
            cbx2.SelectedIndexChanged += new EventHandler(cbx2_SelectedIndexChanged);
            //
            _webQuery = new EasyQuery();
            _webQuery.ConnectionID       = wd.ConnectionID;
            _webQuery.ForReadOnly        = true;
            _webQuery.SQL                = new SQLStatement(wd.SqlString);
            _webQuery.Description        = "Database lookup";
            _webQuery.SqlChanged        += new EventHandler(_webQuery_SqlChanged);
            propertyGrid1.SelectedObject = _webQuery;
            _webQuery.SetLoaded();
            //
            loadWebDataFields();
        }