Ejemplo n.º 1
0
        private void LoadDatabaseFilteredObjects()
        {
            try
            {
                tError.Text = "";

                cbObjects.Items.Clear();

                using (DataStuff sn = new DataStuff())
                {
                    DataTable dt = sn.GetDatabaseObjectsFiltered(ConnectionString, cbDatabaseName.Text, FilterString, ObjectsSelected, false);

                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow row in dt.Rows)
                        {
                            cbObjects.Items.Add(row["Name"].ToString());
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                tError.Text = ex.Message;
            }
        }
Ejemplo n.º 2
0
        private void LoadDatabaseFilteredObjectsPOP()
        {
            string ObjectList = string.Empty;

            try
            {
                ObjectList = GetProjectFilter();

                if (ObjectList.Trim() == "")
                {
                    MessageBox.Show("No objects were found in the current database selected for this project.", "Filter Objects", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                tError.Text = "";

                cbObjects.Items.Clear();

                using (DataStuff sn = new DataStuff())
                {
                    DataTable dt = sn.GetDatabaseObjectsFiltered(ConnectionString, cbDatabaseName.Text, ObjectList, ObjectsSelected, true);

                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow row in dt.Rows)
                        {
                            cbObjects.Items.Add(row["Name"].ToString());
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                tError.Text = ex.Message;
            }
        }