title: Storing data from one table to another
body: <p>I have vehicle master table in mysql called asset. Driver has to enter 3 due dates namely insurance due date, fitness certificate due date and road tax due date in 3 different columns.</p>
  
  <p>There is one more table called vehiclenotification table which has notification type column for insurance, fitness and roadtax dates to be stored 12 times 4 records for each type based on alerts to be sent 15 days prior 7 days, 1 day and on same day of due date.</p>
  
  <p>How do I pass all the 3 dates in one column called due date of vehiclenotification table and 12 records saved under notification date colum of the vehiclenotification table?</p>
  
  <pre><code>Vehicle Master Table: CREATE TABLE asset ( 
      asID int(11) NOT NULL AUTO_INCREMENT, 
      asCode varchar(15) DEFAULT NULL COMMENT 'Asset CODE', 
      asName varchar(100) DEFAULT NULL COMMENT 'Asset NAME', 
      asInsuranceDueDt int(11) DEFAULT NULL COMMENT 'Insurance Due DATE', 
      asFitCertDueDate int(11) DEFAULT NULL COMMENT 'Fitness Certificate Due DATE', 
      asRoadTaxDueDt int(11) DEFAULT NULL COMMENT 'Road Tax Due DATE', 
      asBattLastChargeDate int(11) DEFAULT NULL COMMENT 'Battery LAST Charge DATE' )
  
  Vehicle Mail Notification Table: CREATE TABLE assetemailnotification ( 
      anID INT(11) NOT NULL AUTO_INCREMENT, 
      asID INT(11) NOT NULL, 
      anType SMALLINT(2) DEFAULT NULL COMMENT '1-&gt;Insurance, 2-&gt;Fitnes Certificate, 3-&gt;Road Tax', 
      anNoOdays SMALLINT(2) DEFAULT NULL COMMENT 'No Of days Notification', 
      anDueDate INT(11) DEFAULT NULL COMMENT 'Notification Due Date', 
      anNotificationDate INT(11) DEFAULT NULL, 
      anStatus SMALLINT(1) DEFAULT NULL COMMENT '0-&gt;Not Send, 1-Send', 
      acAccID INT(11) DEFAULT NULL PRIMARY KEY (anID) )
           private int InsertRecord()
  {
      int _retVal = -1;
      try
      {
          int _errorCode = (int)ErrorCodes.NoError;
          string _tblNM = DBStructure.TABLE_ASSET_MASTER;
  
          FieldNames[] _selFlds = new FieldNames[1];
          _selFlds[0].FieldName = DBStructure.ASSET_MASTER_CODE;
  
          cndCheck[] _whCnd = new cndCheck[2];
  
          _whCnd[0].FieldName = DBStructure.ASSET_MASTER_CODE;
          _whCnd[0].FieldType = Fieldtypes.Char;
          _whCnd[0].FirstFieldValue = AssetCode.ToString();
          _whCnd[0].ArithmeticOp = ArithmeticOperator.EQUALS;
          _whCnd[0].LogicOp = LogicalOperator.AND;
  
          _whCnd[1].FieldName = DBStructure.ASSET_MASTER_ACCOUNT_ID;
          _whCnd[1].FieldType = Fieldtypes.Integer;
          _whCnd[1].FirstFieldValue = UserGroupID.ToString();
          _whCnd[1].ArithmeticOp = ArithmeticOperator.EQUALS;
  
           DataSet _dsAsset = _dalAccess.Select(false, _tblNM, true, _selFlds, _whCnd, out _errorCode);
  
           if (_errorCode == (int)ErrorCodes.NoError)
           {
               if (_dsAsset.Tables[0].Rows.Count &gt; 0)
                   StatusDescription = GetGlobalResourceObject(ResorceFileName, "AssetExists").ToString();
               else
               {
                   RecordValues[] _newRec = new RecordValues[24];
  
                   _newRec[0].FieldName = DBStructure.ASSET_MASTER_CODE;
                   _newRec[0].FieldType = Fieldtypes.VarChar;
                   _newRec[0].FieldValue = AssetCode;
  
                   _newRec[1].FieldName = DBStructure.ASSET_MASTER_NAME;
                   _newRec[1].FieldType = Fieldtypes.VarChar;
                   _newRec[1].FieldValue = AssetName;  
  
                   _newRec[16].FieldName = DBStructure.ASSET_MASTER_INSURANCE_DUE_DATE;
                   _newRec[16].FieldType = Fieldtypes.Integer;
                   _newRec[16].FieldValue = String.IsNullOrEmpty(InsuranceDueDate.ToString()) ? null : InsuranceDueDate.ToString();
  
                   _newRec[17].FieldName = DBStructure.ASSET_MASTER_FITNESS_CERTIFICATION_DUE_DATE;
                   _newRec[17].FieldType = Fieldtypes.Integer;
                   _newRec[17].FieldValue = String.IsNullOrEmpty(FitnessCertificationDueDate.ToString()) ? null : FitnessCertificationDueDate.ToString();
  
                   _newRec[18].FieldName = DBStructure.ASSET_MASTER_ROAD_TAX_DUE_DATE;
                   _newRec[18].FieldType = Fieldtypes.Integer;
                   _newRec[18].FieldValue = String.IsNullOrEmpty(RoadTaxDueDate.ToString()) ? null : RoadTaxDueDate.ToString();
  
                   _retVal = _dalAccess.Insert(false, _tblNM, _newRec, out _errorCode);
                   if (_errorCode == (int)ErrorCodes.NoError)
                   {
                       StatusDescription = GetGlobalResourceObject(globalResourceFileName, "InsertedSucessfully").ToString();
  
                   }
               }
           }
           else
               StatusDescription = _errorLogger.GetErrorMessage(_errorCode);
          return _retVal;
      }
      catch (Exception Ex)
      {
          _errorLogger.PrintUnknownError(Ex.Message.ToString(), GetModuleName(), GetPageName(), "InsertRecord()");
          return -1;
      }
  }
  </code></pre>