コード例 #1
0
ファイル: DomainTableRow.cs プロジェクト: 15831944/backsight
            /// <summary>
            /// Loads the domain table from the database
            /// </summary>
            /// <param name="connectionString">The connection string for the database holding domain data.</param>
            /// <returns>A index of the domain table, keyed by the short value</returns>
            Dictionary <string, string> LoadDomainTable(string connectionString)
            {
                IDataServer ds = new DataServer(connectionString);
                Dictionary <string, string> result = new Dictionary <string, string>();
                DataTable table = ds.ExecuteSelect("SELECT [ShortValue], [LongValue] FROM " + TableName);

                foreach (DataRow row in table.Select())
                {
                    string key = row[0].ToString();
                    string val = row[1].ToString();
                    result.Add(key, val);
                }

                return(result);
            }