Beispiel #1
0
        //returns the all  "rows" found in database
        public Dictionary <string, SpecialCharacterRow> GetSpecialCharacterAllRows()
        {
            string sqlString = GetSpecialCharacter_SQLString_NoWhere();
            Dictionary <string, SpecialCharacterRow> myOut = new Dictionary <string, SpecialCharacterRow>();

            DataSet           ds     = mSqlCommand.ExecuteSelect(sqlString, null);
            DataRowCollection myRows = ds.Tables[0].Rows;

            if (myRows.Count < 1)
            {
                throw new PCAxis.Sql.Exceptions.DbException(44, "SpecialCharacter", "SPECIALCHARACTER");
            }

            foreach (DataRow sqlRow in myRows)
            {
                SpecialCharacterRow outRow = new SpecialCharacterRow(sqlRow, DB, mLanguageCodes);
                myOut.Add(outRow.CharacterType, outRow);
            }
            return(myOut);
        }
Beispiel #2
0
        //returns the single "row" found when all PKs are spesified
        public SpecialCharacterRow GetSpecialCharacterRow(string aCharacterType)
        {
            //SqlDbConfig dbconf = DB;
            string sqlString = GetSpecialCharacter_SQLString_NoWhere();

            sqlString += " WHERE " + DB.SpecialCharacter.CharacterTypeCol.Is(mSqlCommand.GetParameterRef("aCharacterType"));

            // creating the parameters
            System.Data.Common.DbParameter[] parameters = new System.Data.Common.DbParameter[1];
            parameters[0] = mSqlCommand.GetStringParameter("aCharacterType", aCharacterType);

            DataSet           ds     = mSqlCommand.ExecuteSelect(sqlString, parameters);
            DataRowCollection myRows = ds.Tables[0].Rows;

            if (myRows.Count != 1)
            {
                throw new PCAxis.Sql.Exceptions.DbException(36, " CharacterType = " + aCharacterType);
            }

            SpecialCharacterRow myOut = new SpecialCharacterRow(myRows[0], DB, mLanguageCodes);

            return(myOut);
        }