示例#1
0
 /// <summary>
 /// ����������ṹ��ͬ�Ŀ�DataRow���󣬲�����������ֵ
 /// </summary>
 /// <param name="pkFieldName">�����ֶ�</param>
 /// <returns>DataRow����</returns>
 public override DataRow NewRow(string pkFieldName)
 {
     if(_loaded)
     {
         DataRow row = this._dataTable.NewRow();
         if(this.m_pKey == null)
             this.m_pKey = pkFieldName;
         DbUtil util = new DbUtil();
         this.m_identity = Convert.ToInt32(util.NextIncreaseID(this.m_pKey));
         row[pkFieldName] = this.m_identity;
         return row;
     }
     else
     {
         return null;
     }
 }
示例#2
0
 /// <summary>
 /// ����������ṹ��ͬ�Ŀ�DataRow���󣬲�����������ֵ
 /// </summary>
 /// <param name="pkFieldName">��������</param>
 /// <returns>DataRow����</returns>
 public override DataRow NewRow(int pkFieldIndex)
 {
     if(_loaded)
     {
         if(this.m_pKey == null)
         {
             throw new Exception("û��ָ���������,�޷����������С�");
         }
         DbUtil util = new DbUtil();
         DataRow row = this._dataTable.NewRow();
         this.m_identity = Convert.ToInt32(util.NextIncreaseID(this.m_pKey));
         row[pkFieldIndex] = this.m_identity;
         return row;
     }
     else
     {
         return null;
     }
 }