Example #1
0
        private SoundExArray LoadSound()
        {
            SoundExArray soundExArray = new SoundExArray();
            SoundExArray result;

            try
            {
                DataProvider  dataProvider  = new DataProvider();
                string        sqlString     = "SELECT [sound_id],[sound_code] ,[sound_type] ,[sound_path] FROM  [dbo].[SOUNDS]Order by sound_id;";
                SqlDataReader sqlDataReader = dataProvider.excuteQuery(sqlString);
                while (sqlDataReader.Read())
                {
                    int    i_sound_id   = int.Parse(sqlDataReader[0].ToString());
                    string s_sound_code = sqlDataReader[1].ToString();
                    int    i_sound_type;
                    if (sqlDataReader[2].ToString() != "")
                    {
                        i_sound_type = int.Parse(sqlDataReader[2].ToString());
                    }
                    else
                    {
                        i_sound_type = 0;
                    }
                    string      s_sound_path = sqlDataReader[3].ToString();
                    SoundExInfo si           = new SoundExInfo(i_sound_id, s_sound_code, i_sound_type, s_sound_path);
                    soundExArray.Add(si);
                }
                sqlDataReader.Close();
            }
            catch (SqlException ex)
            {
                MyMsgBox.MsgError(ex.Message);
                result = new SoundExArray();
                return(result);
            }
            result = soundExArray;
            return(result);
        }
Example #2
0
 public void Add(SoundExInfo si)
 {
     base.List.Add(si);
 }