Пример #1
0
        private void BuildList()
        {
            lstDatasets.Items.Clear();
            AccessFDB fdb = (_providerId == "mssql" ? new SqlFDB() : new AccessFDB());

            if (!fdb.Open(this.ConnectionString))
            {
                MessageBox.Show(fdb.lastErrorMsg, "Error");
                return;
            }

            string[] dsnames = fdb.DatasetNames;
            string   imageSpace;

            if (dsnames != null)
            {
                foreach (string dsname in dsnames)
                {
                    ListViewItem item = new ListViewItem(
                        dsname, fdb.IsImageDataset(dsname, out imageSpace) ? 1 : 0);
                    lstDatasets.Items.Add(item);

                    if (item.Text == _dsname)
                    {
                        lstDatasets.SelectedIndices.Add(lstDatasets.Items.Count - 1);
                    }
                }
            }
        }