Esempio n. 1
0
 /// <summary>
 /// �����ݿ��м�������
 /// </summary>
 /// <param name="selectCommandText">SELECT���</param>
 /// <param name="loadDataTableType">�������ݵķ�ʽ</param>
 protected abstract void Load(string selectCommandText, LoadDataTableType loadDataTableType);
Esempio n. 2
0
 /// <summary>
 /// �����ݿ��м�������
 /// </summary>
 /// <param name="selectCommandText">SELECT���</param>
 /// <param name="loadDataTableType">�������ݵķ�ʽ</param>
 protected override void Load(string selectCommandText, LoadDataTableType loadDataTableType)
 {
     //��ṹ�����仯ʱ�������½�_dataTable�����������������������
     //ʱ�ᵼ��Լ����ͻ
     switch(loadDataTableType)
     {
         case LoadDataTableType.Merge://�ϲ�
             break;
         case LoadDataTableType.Clear://���
             this._dataTable.Clear();
             break;
         case LoadDataTableType.Reset://����
             this._dataTable.Reset();
             break;
         case LoadDataTableType.New://�½�
             if(this._dataTable != null)
                 this._dataTable.Dispose();
             this._dataTable = new DataTable();
             break;
         case LoadDataTableType.None:
             break;
     }
     try
     {
         AdoHelper helper = AdoHelper.Create();
         _oracleConnection = (OracleConnection)helper.GetConnection();
         this._oracleDataAdapter = (OracleDataAdapter)helper.GetDataAdapter(selectCommandText, _oracleConnection);
         this._oracleDataAdapter.Fill(this._dataTable);
         _loaded = true;
     }
     catch(Exception ex)
     {
         string s = ex.Message;
         if(this._oracleDataAdapter != null)
             this._oracleDataAdapter.Dispose();
         _loaded = false;
     }
 }