Exemple #1
0
        /// <summary>Return a list of open bugs</summary>
        public BugTracker[] GetIssueList()
        {
            List <BugTracker> bugs = new List <BugTracker>();

            string connectionString = File.ReadAllText(@"D:\Websites\bugTrackerConnect.txt");

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();

                string sql = "SELECT bg_id, bg_short_desc FROM bugs WHERE (bg_status <> 5) ORDER BY bg_id DESC";

                using (SqlCommand command = new SqlCommand(sql, connection))
                {
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            BugTracker bug = new BugTracker();
                            bug.bugID       = (int)reader["bg_id"];
                            bug.description = (string)reader["bg_short_desc"];
                            bugs.Add(bug);
                        }
                    }
                }

                connection.Close();
            }

            return(bugs.ToArray());
        }
        /// <summary>Return a list of open bugs</summary>
        public BugTracker[] GetIssueList()
        {
            List<BugTracker> bugs = new List<BugTracker>();

            string connectionString = File.ReadAllText(@"D:\Websites\bugTrackerConnect.txt");
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();

                string sql = "SELECT bg_id, bg_short_desc FROM bugs WHERE (bg_status <> 5) ORDER BY bg_id DESC";

                using (SqlCommand command = new SqlCommand(sql, connection))
                {
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            BugTracker bug = new BugTracker();
                            bug.bugID = (int)reader["bg_id"];
                            bug.description = (string)reader["bg_short_desc"];
                            bugs.Add(bug);
                        }
                    }
                }

                connection.Close();
            }

            return bugs.ToArray();
        }