Пример #1
0
  }//public static void Main

  /// <summary>Stub</summary>
  public static void Stub()
  {
   UtilityEventLog.WriteEntry
   (
    null,          //Log name
    null,          //Machine name
    null,          //Source
    null,          //Message
    EventLogEntryType.Information
   );
  }//public static void Stub()
  }//public void CreateUserWizard_SendingMail()

  /// <summary>CreateUserWizard_SendingMailError</summary>
  public void CreateUserWizard_SendMailError
  (
   object                  sender, 
   SendMailErrorEventArgs  sendMailErrorEventArgs
  )
  {
   UtilityEventLog.WriteEntry
   (
    "Application", //Log
    null,          //Machine name
    "Membership",  //Source
    "Sending mail via SMTP failed with the following error: " + 
    sendMailErrorEventArgs.Exception.Message.ToString(), 
    System.Diagnostics.EventLogEntryType.Error
   );
   sendMailErrorEventArgs.Handled = true;
  }//public void CreateUserWizard_SendMailError()
Пример #3
0
  }//public static main( string[] argv )

  ///<summary>ExceptionLog</summary>
  public static void ExceptionLog
  (
       Exception exception,
       string    exceptionClass,    
   ref string    exceptionMessage
  )
  {
   HttpContext       httpContext     =  HttpContext.Current;
   try
   {
   	if ( exceptionMessage == null )
   	{
   	 exceptionMessage = string.Format
   	 (
   	  "{0} Message: {1} | TargetSite: {2} | StackTrace: {3} | InnerException: {4} | Source: {5} | HelpLink: {6}",
      exceptionClass,
      exception.Message,
      exception.TargetSite,
      exception.StackTrace,
      exception.InnerException,
      exception.Source,
      exception.HelpLink
     );
    }//if ( exceptionMessage == null )
    if ( httpContext == null )
    {
     System.Console.WriteLine( exceptionMessage );    	
    }
    UtilityEventLog.WriteEntry
    (
     exceptionMessage
    );
   }//try
   catch ( Exception e )
   {
    exceptionMessage = "Exception: " + e.Message;
   }//catch ( Exception exception )
  }//public static ExceptionLog()
Пример #4
0
  }//ConfigurationXml	 

  /// <summary>Scripture Reference URI.</summary>
  /// <param name="databaseConnectionString">The database connection string.</param>
  /// <param name="filenameConfigurationXml">The filename configuration Xml.</param>
  /// <param name="exceptionMessage">The exception message.</param>  
  /// <param name="dataSet">The dataset.</param>
  public static void ScriptureReferenceURI
  (
       string  databaseConnectionString,
       string  filenameConfigurationXml,
   ref string  exceptionMessage,
   ref DataSet dataSet
  )
  {
   bool                                         boolView                                  = false;
   
   int                                          columnIndexScriptureReference             = -1;
   
   string                                       dataColumnName                            = null;
   string                                       scriptureReferenceColumnValue             = null;
   string                                       scriptureReferenceColumnName              = null;
   string                                       scriptureReferenceColumnNameURI           = null;
   string                                       scriptureReferenceURI                     = null;   
   string[][]                                   scriptureReferenceArray                   = null;    
   string                                       columnNamePrimary                         = null;
   string                                       columnValuePrimary                        = null; 
   string                                       tableName                                 = null;
   
   ArrayList                                    scriptureReferenceSet                     = null;
   ArrayList                                    scriptureReferenceURISet                  = null;
   ScriptureReferenceBookChapterVersePrePost[]  scriptureReferenceBookChapterVersePrePost = null;
   StringBuilder                                columnSet                                 = null;   
   StringBuilder                                uriCrosswalkXml                           = null;
   StringBuilder                                uriCrosswalkHtml                          = null;   
   StringBuilder                                SQLStatement                              = null;      
   OleDbConnection                              oleDbConnection                           = null;
   XmlNodeList                                  scriptureReferenceColumnSet               = null;

   scriptureReferenceColumnSet = UtilityXml.SelectNodes
   (
        filenameConfigurationXml,
    ref exceptionMessage,
        XPathColumnScriptureReference
   );
   try
   {
    oleDbConnection = UtilityDatabase.DatabaseConnectionInitialize
    (
         databaseConnectionString,
     ref exceptionMessage
    ); 

    foreach ( DataTable dataTable in dataSet.Tables )
    {
   
     columnIndexScriptureReference = UtilityDatabase.DataTableColumnIndex
     (
      dataTable,
      "ScriptureReference"
     ); 
     
     if ( columnIndexScriptureReference < 0 )
     {
      continue;
     }           	
    	
     tableName                = dataTable.TableName;
     scriptureReferenceSet    = new ArrayList();
     scriptureReferenceURISet = new ArrayList();
     SQLStatement = new StringBuilder();
     
     if ( tableName.IndexOf("View" ) < 0 )
     {
      boolView = false;
      SQLStatement.AppendFormat
      (
       InformationSchemaColumnNamePrimaryColumnSQL,
       tableName
      );
     }
     else
     {
      boolView = true;	
      SQLStatement.AppendFormat
      (
       InformationSchemaColumnNamePrimaryColumnSQL,
       tableName.Substring(4)
      );
     }

      #if (DEBUG)
       System.Console.WriteLine("SQLStatement: {0}", SQLStatement);
      #endif
     
     columnNamePrimary = (string) UtilityDatabase.DatabaseQuery
     (
          databaseConnectionString,
      ref exceptionMessage,
          SQLStatement.ToString(),
          CommandType.Text
     );
     
     if ( boolView == true )
     {
      columnNamePrimary = String.Concat( tableName.Substring(4), columnNamePrimary );	
     }	 

     #if (DEBUG)
      System.Console.WriteLine("ColumnNamePrimary: {0}", columnNamePrimary);
     #endif
     
     foreach ( DataColumn dataColumn in dataTable.Columns )
     {
      dataColumnName = dataColumn.ColumnName.Trim();
      /*
      #if (DEBUG)
       System.Console.WriteLine("Table Name: {0} | ColumnName: {1}", tableName, dataColumnName);
      #endif
      */
      if ( dataColumnName.IndexOf( ScriptureReferenceURIColumnNamePostfix ) >= 0 )
      {
       continue;
      }
      if ( dataColumnName.IndexOf( ScriptureReferenceColumnNamePostfix ) >= 0 )
      {
       scriptureReferenceSet.Add( dataColumnName );
       scriptureReferenceColumnName    = dataColumnName;
       scriptureReferenceColumnNameURI = scriptureReferenceColumnName + "URI";
       if ( dataTable.Columns.Contains( scriptureReferenceColumnNameURI ) == false )
       {
        /*
        #if (DEBUG)
         System.Console.WriteLine("Table Name: {0} | ColumnName: {1}", tableName, scriptureReferenceColumnNameURI);
        #endif
        */
        scriptureReferenceURISet.Add( scriptureReferenceColumnNameURI );
       }//if dataTable.Columns.Contains( scriptureReferenceColumnNameURI ) == false )
      }//if ( dataColumnName.IndexOf( ScriptureReferenceColumnNamePostfix ) >= 0 )
     }//foreach ( DataColumn dataColumn in dataTable.Columns )

     foreach ( object columnName in scriptureReferenceURISet )
     {
      scriptureReferenceColumnNameURI = columnName.ToString().Trim();
      dataTable.Columns.Add( scriptureReferenceColumnNameURI );
     }

     foreach ( DataColumn dataColumn in dataTable.Columns )
     {
      dataColumnName = dataColumn.ColumnName.Trim();
      /*
       #if (DEBUG)
        System.Console.WriteLine("Table Name: {0} | ColumnName: {1}", tableName, dataColumnName);
       #endif
      */ 
     }//foreach ( DataColumn dataColumn in dataTable.Columns )

     foreach ( DataRow dataRow in dataTable.Rows )
     {
      columnValuePrimary = dataRow[columnNamePrimary].ToString().Trim();
      columnSet = new StringBuilder();
      /*
       #if (DEBUG)
        System.Console.WriteLine("ColumnValuePrimary: {0}", columnValuePrimary);
       #endif
      */ 
      foreach ( object columnName in scriptureReferenceSet )
      {
       #if (DEBUG)
        System.Console.WriteLine("ColumnName: {0}", columnName);
       #endif
       scriptureReferenceColumnName  = columnName.ToString().Trim();
       scriptureReferenceColumnValue = dataRow[scriptureReferenceColumnName].ToString().Trim();
     
       #if (DEBUG)
        System.Console.WriteLine
        (
         "Scripture Reference Column Name: {0} | Value: {1}", 
         scriptureReferenceColumnName,
         scriptureReferenceColumnValue
        );
       #endif
       scriptureReferenceColumnNameURI = scriptureReferenceColumnName + "URI";
       if ( scriptureReferenceColumnValue != null && scriptureReferenceColumnValue != string.Empty )
       {
        ScriptureReference.ScriptureReferenceParser
        (
             new string[] { scriptureReferenceColumnValue },
             databaseConnectionString,
         ref exceptionMessage,
         ref scriptureReferenceBookChapterVersePrePost,
         ref scriptureReferenceArray,
         ref uriCrosswalkHtml,
         ref uriCrosswalkXml
        );//ScriptureReference.ScriptureReferenceParser()
        scriptureReferenceURI = uriCrosswalkHtml.ToString();
        if ( UtilityDatabase.DataSetTableColumnContains( dataSet, tableName, scriptureReferenceColumnNameURI ) == false )
        {
         UtilityDatabase.DataSetTableColumnAdd( dataSet, tableName, scriptureReferenceColumnNameURI );	
         dataRow[scriptureReferenceColumnNameURI] = scriptureReferenceURI;
         continue;
        }//if ( DataSetTableColumnContains( dataSet, dataTable, scriptureReferenceColumnNameURI ) )	
        dataRow[scriptureReferenceColumnNameURI] = scriptureReferenceURI;
        if ( scriptureReferenceURISet.IndexOf( scriptureReferenceColumnNameURI ) >= 0 )
        {
         continue;
        }

        if ( columnSet.Length != 0 )
        {
         columnSet.Append(',');
        }
        columnSet.AppendFormat
        (
         UtilityDatabase.DatabaseTemplateSQLSet,
         scriptureReferenceColumnNameURI,
         scriptureReferenceURI
        ); 
        /*
        #if (DEBUG)
         System.Console.WriteLine("columnSet: {0}", columnSet);      
        #endif
        */
        SQLStatement = new StringBuilder();
        SQLStatement.AppendFormat
        (
         UtilityDatabase.DatabaseTemplateSQLUpdateScriptureReferenceURISet,
         tableName,
         columnSet,
         columnNamePrimary,
         columnValuePrimary
        );   
        #if (DEBUG)
         System.Console.WriteLine("SQL Statement: {0}", SQLStatement.ToString() );      
        #endif
        UtilityDatabase.DatabaseNonQuery
        (
             oleDbConnection,
         ref exceptionMessage,
             SQLStatement.ToString()
        );
       }//if ( scriptureReferenceColumnValue != null && scriptureReferenceColumnValue != string.Empty )
      }//foreach ( object columnName in dataTableColumnName )
     }//foreach ( DataRow dataRow in dataTable )
    }//foreach ( DataTable dataTable in dataSet ) 
    UtilityDatabase.DatabaseConnectionHouseKeeping
    (
         oleDbConnection,
     ref exceptionMessage
    );
   }//try
   catch (OleDbException exception)
   {
    //exceptionMessage = exception.Message;
    exceptionMessage = UtilityEventLog.WriteEntryOleDbErrorCollection( exception );
    System.Console.WriteLine("OleDbException: {0}", exceptionMessage);
   }//catch (OleDbException exception)
   catch (SecurityException exception)
   {
    exceptionMessage = exception.Message;
    System.Console.WriteLine( "SecurityException: {0}", exception.Message );
   }//catch (SecurityException exception)
   catch (SystemException exception)
   {
    exceptionMessage = exception.Message;
    System.Console.WriteLine( "SystemException: {0}", exception.Message );
   }//catch (SystemException exception)
   catch (Exception exception)
   {
    exceptionMessage = exception.Message;   
    System.Console.WriteLine( "Exception: {0}", exception.Message );
   }//catch (Exception exception)
  }//public static void ScriptureReferenceURI()
Пример #5
0
  }//static void Main( string[] argv )
  
  ///<summary>XmlParse()</summary>
  static void XmlParse
  ( 
       string    databaseConnectionString,
   ref string    exceptionMessage,
       string[]  xmlDocumentFilenames
  )
  {
   
   int                       childrenCount                    =  0;
   int                       childrenTotal                    =  0;
   
   int                       elementConfigurationCount        =  0;
   int                       elementConfigurationIndex        =  0;
   int                       elementConfigurationTotal        =  ElementConfiguration.Length;
   
   int                       grandChildrenCount               =  0;
   int                       grandChildrenTotal               =  0;
   int                       grandChildrenValueLength         =  0;   
   
   int                       oleDbParameterCollectionCount    =  0;
   int                       oleDbParameterCollectionIndex    =  0;   
   int                       oleDbParameterCollectionTotal    =  0;
   
   string[][]                children                         =  null;
   string[][]                grandChildren                    =  null;   

   DateTime                  dateTime                         =  new DateTime();

   OleDbConnection           oleDbConnection                  =  null;
   OleDbCommand              oleDbCommand                     =  null;
   OleDbParameterCollection  oleDbParameterCollection         =  null;
  
   XPathDocument             xPathDocument                    = null;

   XPathNavigator            xPathNavigatorChildren           = null;
   XPathNavigator            xPathNavigatorGrandChildren      = null;
   XPathNavigator            xPathNavigatorParent             = null;
   
   XPathNodeIterator         xPathNodeIteratorChildren        = null;
   XPathNodeIterator         xPathNodeIteratorGrandChildren   = null;
   XPathNodeIterator         xPathNodeIteratorParent          = null;   

   //Open the database connection.
   oleDbConnection = UtilityDatabase.DatabaseConnectionInitialize( databaseConnectionString, ref exceptionMessage );
   
   foreach ( string xmlDocumentFilename in xmlDocumentFilenames )
   {
    if ( !File.Exists( xmlDocumentFilename ) )
    {
     System.Console.WriteLine("File Not Found: {0}", xmlDocumentFilename );
     continue;
    }//if ( !File.Exists( xmlDocumentFilename ) )

    #if ( DEBUG )
     System.Console.WriteLine("XML Document Filename: {0}", xmlDocumentFilename);      
    #endif
         
    try
    {
     //Create an XML document instance, and load XML data.
     xPathDocument             = new XPathDocument( xmlDocumentFilename );

     xPathNavigatorParent      = xPathDocument.CreateNavigator();
     xPathNodeIteratorParent   = xPathNavigatorParent.SelectChildren( XPathNodeType.Element );

     xPathNodeIteratorParent.MoveNext();

     xPathNavigatorChildren    = xPathNodeIteratorParent.Current;
     xPathNodeIteratorChildren = xPathNavigatorChildren.SelectChildren( XPathNodeType.Element );
     childrenCount             = -1;
     childrenTotal             = xPathNodeIteratorChildren.Count;
    
     children                  = new string[childrenTotal][];

     while ( xPathNodeIteratorChildren.MoveNext() )
     {
      ++childrenCount;
      children[childrenCount]  = new string[2];
      children[childrenCount][NodeRankName]  = xPathNodeIteratorChildren.Current.Name.Trim();
      children[childrenCount][NodeRankValue] = xPathNodeIteratorChildren.Current.ToString().Trim();     

      /*
      #if ( DEBUG )
       System.Console.WriteLine
       (
        "Children Name: {0} | Value: {1}",
        children[childrenCount][NodeRankName],
        children[childrenCount][NodeRankValue]
       );      
      #endif
      */
      
      for 
      ( 
       elementConfigurationCount = 0, elementConfigurationIndex = -1; 
       elementConfigurationCount < elementConfigurationTotal; 
       ++elementConfigurationCount 
      )
      {       
       if ( ElementConfiguration[elementConfigurationCount][ElementRankName] == children[childrenCount][NodeRankName] )
       {
        elementConfigurationIndex = elementConfigurationCount;
       }//if ( ElementConfiguration[elementConfigurationCount][ElementRankName] == children[childrenCount][NodeRankName] )        
      }//for ( elementConfigurationCount = 0, elementConfigurationIndex = -1; elementConfigurationCount < elementConfigurationTotal; ++elementConfigurationCount )       
     
      //Element not found; therefore, do not process.
      if ( elementConfigurationIndex == -1 )
      {
       continue;        
      }//if ( elementConfigurationIndex == -1 )
        
      oleDbCommand = new OleDbCommand
      ( 
       ElementConfiguration[elementConfigurationIndex][ElementRankStoredProcedure], 
       oleDbConnection 
      );
      
      oleDbCommand.CommandType = CommandType.StoredProcedure;
      OleDbCommandBuilder.DeriveParameters(  oleDbCommand );
      oleDbParameterCollection       = oleDbCommand.Parameters;
      oleDbParameterCollectionTotal  = oleDbParameterCollection.Count;
     
      xPathNavigatorGrandChildren    = xPathNodeIteratorChildren.Current;
      xPathNodeIteratorGrandChildren = xPathNavigatorGrandChildren.SelectChildren( XPathNodeType.Element );
      grandChildrenCount             = -1;
      grandChildrenTotal             = xPathNodeIteratorGrandChildren.Count;
      grandChildren                  = new string[grandChildrenTotal][];

      while ( xPathNodeIteratorGrandChildren.MoveNext() )
      {
       ++grandChildrenCount;        
       grandChildren[grandChildrenCount] = new string[2];        
       grandChildren[grandChildrenCount][NodeRankName]  = xPathNodeIteratorGrandChildren.Current.Name.Trim();
       grandChildren[grandChildrenCount][NodeRankValue] = xPathNodeIteratorGrandChildren.Current.ToString().Trim();
       grandChildrenValueLength                         = grandChildren[grandChildrenCount][NodeRankValue].Length;
       for 
       ( 
        oleDbParameterCollectionCount = 0, oleDbParameterCollectionIndex = -1; 
        oleDbParameterCollectionCount < oleDbParameterCollectionTotal; 
        ++oleDbParameterCollectionCount
       ) 
       {
        if ( string.Compare ( grandChildren[grandChildrenCount][NodeRankName], oleDbParameterCollection[oleDbParameterCollectionCount].ParameterName, true ) == 0 )
        {
         oleDbParameterCollectionIndex = oleDbParameterCollectionCount;
         switch ( oleDbParameterCollection[oleDbParameterCollectionCount].OleDbType )
         {
          case OleDbType.DBTimeStamp:
           if ( grandChildrenValueLength == 12 || grandChildrenValueLength == 14 )
           {
            dateTime = UtilityDateTimeParse.DateTimeParse( grandChildren[grandChildrenCount][NodeRankValue] );
           }//if ( grandChildrenValueLength == 12 || grandChildrenValueLength == 14 )
           else if ( grandChildrenValueLength == 33 )
           {
            dateTime = XmlConvert.ToDateTime( grandChildren[grandChildrenCount][NodeRankValue] ); 
           }//else if ( grandChildren[grandChildrenCount][NodeRankValue].Length == 33 )            
           oleDbParameterCollection[oleDbParameterCollectionCount].Value = dateTime; 
           break;
          
          default:                 
           oleDbParameterCollection[oleDbParameterCollectionCount].Value = grandChildren[grandChildrenCount][NodeRankValue];
           break;
         }//switch ( oleDbParameterCollection[oleDbParameterCollectionCount].OleDbType )
         break; 
        }//if ( string.Compare ( grandChildren[grandChildrenCount][NodeRankName], oleDbParameterCollection[oleDbParameterCollectionCount].ParameterName, true ) == 0 )
       }//foreach ( OleDbParameter oleDbParameter in oleDbParameters )
       #if ( DEBUG )
        if ( oleDbParameterCollectionIndex > -1 ) //Database Parameter Found.
        {
         System.Console.WriteLine
         (        
          "OleDbParameter Name: {0} | Type: {1} | Value: {2}",
          oleDbParameterCollection[oleDbParameterCollectionIndex].ParameterName,
          oleDbParameterCollection[oleDbParameterCollectionIndex].OleDbType,
          oleDbParameterCollection[oleDbParameterCollectionIndex].Value           
         );
        }//Database Parameter Found.
        else
        {
         System.Console.WriteLine
         (        
          "GrandChildren Name: {0} | Value: {1}",
          grandChildren[grandChildrenCount][NodeRankName],
          grandChildren[grandChildrenCount][NodeRankValue]
         );
        }//Database Parameter Not Found.
        #endif            
      }//while ( xPathNodeIteratorGrandChildren.MoveNext() )

      for 
      ( 
       oleDbParameterCollectionCount = 0; 
       oleDbParameterCollectionCount < oleDbParameterCollectionTotal; 
       ++oleDbParameterCollectionCount
      )
      {
       switch ( oleDbParameterCollection[oleDbParameterCollectionCount].OleDbType )
       {
        case OleDbType.Guid:
         if ( oleDbParameterCollection[oleDbParameterCollectionCount].Value == null )
         {
          oleDbParameterCollection[oleDbParameterCollectionCount].Value = System.Guid.NewGuid();  
         }   
         break;
       }//switch ( oleDbParameterCollection[oleDbParameterCollectionCount].OleDbType )
      }//for ( oleDbParameterCollectionCount = 0; oleDbParameterCollectionCount < oleDbParameterCollectionTotal; ++oleDbParameterCollectionCount )

      oleDbCommand.ExecuteNonQuery();
     }//while ( xPathNodeIteratorChildren.MoveNext() )
    }//try    
    catch( OleDbException oleDbException )
    {
     exceptionMessage = UtilityEventLog.WriteEntryOleDbErrorCollection( oleDbException );
     System.Console.WriteLine("OleDbException: {0}", exceptionMessage);
    }//catch( OleDbException oleDbException )
    catch( IOException ioException )
    {
     System.Console.WriteLine("IOException: {0}", ioException.Message);
    }//catch( OleDbException oleDbException )
    catch( XPathException xPathException )
    {
     System.Console.WriteLine("XPathException: {0}", xPathException.Message );
    }//catch( XPathException xPathException )
    catch( XmlException xmlException )
    {
     System.Console.WriteLine("XmlException: {0}", xmlException.Message);
    }//catch(XmlException xmlEx)
    catch( Exception exception )
    {
     System.Console.WriteLine( "Exception: {0}", exception.Message );
    }//catch(Exception ex)
   }//foreach ( string xmlDocumentFilename in xmlDocumentFilenames )
   
   //Close the database connection.
   UtilityDatabase.DatabaseConnectionHouseKeeping( oleDbConnection, ref exceptionMessage );
   
  }//static void XmlParse( string[] xmlDocumentFilenames )
Пример #6
0
  }//Main()
 
  ///<summary>The Import File.</summary>
  ///<param name="databaseConnectionString">The database connection string.</param>
  ///<param name="uriImportFileName">The file names to import.</param>
  public static void URIImportFile
  (
   string   databaseConnectionString,
   string[] uriImportFileName
  )
  {
   int                       importConfigurationCount       =  -1;
   int                       importConfigurationTotal       =  -1;
   int                       importType                     =  -1;

   int                       status                         =  -1;

   string                    exceptionMessage               = null;

   /*
   string                    navigatorLocalName             =  null;
   string                    navigatorValue                 =  null;
   */
   
   string                    nodeName                       =  null;
   string                    nodeValue                      =  null;
  
   DateTime                  dated                          =  DateTime.Now;
   
   Guid                      uriStatusGuid                  =  new Guid();
   
   String                    jehovah                        =  null;
   String                    keyword                        =  null;
   String                    title                          =  null;
   String                    uri                            =  null;
   
   OleDbCommand              oleDbCommandJehovah            =  null;
   OleDbCommand              oleDbCommandURI                =  null;
   OleDbCommand              oleDbCommandURIStatus          =  null;   
   
   OleDbConnection           oleDbConnection                = null;
   
   OleDbParameter            oleDbParameterJehovahDated     =  null;
   OleDbParameter            oleDbParameterJehovahJehovah   =  null;
   OleDbParameter            oleDbParameterJehovahURI       =  null;
   
   OleDbParameter            oleDbParameterURIDated         =  null;
   OleDbParameter            oleDbParameterURIKeyword       =  null;
   OleDbParameter            oleDbParameterURITitle         =  null;   
   OleDbParameter            oleDbParameterURIURI           =  null;

   OleDbParameter            oleDbParameterURIStatusDated   =  null;
   OleDbParameter            oleDbParameterURIStatusGuid    =  null;
   OleDbParameter            oleDbParameterURIStatusURI     =  null;
   OleDbParameter            oleDbParameterURIStatusStatus  =  null;   

   OleDbParameterCollection  oleDbParameterCollectionURI    = null;
   
   XmlDocument               xmlDocument                    =  null;
   XmlElement                xmlElementRoot                 =  null;
   XmlNodeList               xmlNodeListAddress             =  null;
   
   try
   {

     //Open the database connection.
     oleDbConnection = UtilityDatabase.DatabaseConnectionInitialize( databaseConnectionString, ref exceptionMessage );

     importConfigurationTotal  =  ImportConfiguration.Length;

     foreach ( String uriImportFileNameCurrent in uriImportFileName )
     {
    
      //Determine the content of the import file based on the filename pattern for example URIChrist or URIWordEngineering
      importType  =  -1;
      for ( importConfigurationCount =  0; importConfigurationCount < importConfigurationTotal; ++importConfigurationCount )
      {
       if ( uriImportFileNameCurrent.IndexOf( ImportConfiguration[importConfigurationCount][ImportConfigurationFileNamePattern] ) > 0 )
       {
        importType = importConfigurationCount;
        break;
       }
      }
      if ( importType < 0 )
      {
       System.Console.WriteLine("{0} file name pattern.", uriImportFileNameCurrent);
       continue;
      }

      if ( !File.Exists(uriImportFileNameCurrent) )
      {
       System.Console.WriteLine("{0} Not Found.", uriImportFileNameCurrent);
       continue; 
      }      	
 
      oleDbCommandJehovah               =  new OleDbCommand( DatabaseStoredProcedureNameJehovah, oleDbConnection );
      oleDbCommandURI                   =  new OleDbCommand( ImportConfiguration[importType][ImportConfigurationStoredProcedureName], oleDbConnection );
      oleDbCommandURIStatus             =  new OleDbCommand( DatabaseStoredProcedureNameURIStatus, oleDbConnection );

      oleDbCommandJehovah.CommandType   =  CommandType.StoredProcedure;
      oleDbCommandURI.CommandType       =  CommandType.StoredProcedure;
      oleDbCommandURIStatus.CommandType =  CommandType.StoredProcedure;      
       
      oleDbParameterJehovahDated        =  oleDbCommandJehovah.Parameters.Add(ParameterDated,    OleDbType.Date);
      oleDbParameterJehovahJehovah      =  oleDbCommandJehovah.Parameters.Add(ParameterJehovah,  OleDbType.VarChar, SizeJehovah);
      oleDbParameterJehovahURI          =  oleDbCommandJehovah.Parameters.Add(ParameterURI,      OleDbType.VarChar, SizeURI);

      oleDbParameterURIDated            =  oleDbCommandURI.Parameters.Add(ParameterDated,        OleDbType.Date);
      oleDbParameterURIKeyword          =  oleDbCommandURI.Parameters.Add(ParameterKeyword,      OleDbType.VarChar, SizeKeyword);
      oleDbParameterURITitle            =  oleDbCommandURI.Parameters.Add(ParameterTitle,        OleDbType.VarChar, SizeTitle);
      oleDbParameterURIURI              =  oleDbCommandURI.Parameters.Add(ParameterURI,          OleDbType.VarChar, SizeURI);

      oleDbParameterURIStatusURI        =  oleDbCommandURIStatus.Parameters.Add(ParameterURI,    OleDbType.VarChar, SizeURI);
      oleDbParameterURIStatusDated      =  oleDbCommandURIStatus.Parameters.Add(ParameterDated,  OleDbType.Date);
      oleDbParameterURIStatusStatus     =  oleDbCommandURIStatus.Parameters.Add(ParameterStatus, OleDbType.Integer);
      oleDbParameterURIStatusGuid       =  oleDbCommandURIStatus.Parameters.Add(ParameterGuid,   OleDbType.Guid);      
    
      oleDbParameterURIStatusGuid.Direction = ParameterDirection.Output;

      oleDbParameterCollectionURI       =  oleDbCommandURI.Parameters;
      
      xmlDocument                       = new XmlDocument();
      xmlDocument.PreserveWhitespace    = false;
      xmlDocument.Load( uriImportFileNameCurrent );

      xmlElementRoot                    =  xmlDocument.DocumentElement;
      xmlNodeListAddress                =  xmlElementRoot.SelectNodes( XPathExpressionAddress );
      
      foreach ( XmlNode xmlNodeAddress in xmlNodeListAddress )
      {
       //Initialize the default values. 
       dated   = DateTime.Now;
       keyword = null;
       status  = URIStatusHTTP404FileNotFound;
       title   = null;
       uri     = AboutBlank;
       
       foreach (XmlNode xmlNodeAddressElement in xmlNodeAddress )
       {
        nodeName = xmlNodeAddressElement.Name;
        nodeValue = xmlNodeAddressElement.InnerText.Trim();
        switch (nodeName)
        {
         case NameDated: 
          if ( nodeValue != string.Empty )
          { 
           dated = XmlConvert.ToDateTime( nodeValue );
          } 
          oleDbParameterJehovahDated.Value = dated;
          oleDbParameterURIDated.Value = dated;
          oleDbParameterURIStatusDated.Value = dated;
          break;

         case NameJehovah: 
          jehovah = nodeValue;
          System.Console.WriteLine("URI: {0} | Jehovah: {1}", uri, jehovah);          
          oleDbParameterJehovahJehovah.Value  =  jehovah;
          oleDbCommandJehovah.ExecuteNonQuery();
          break;

         case NameStatus:
          if ( nodeValue != string.Empty )
          {
           status = XmlConvert.ToInt16( nodeValue );
          }            
          oleDbParameterURIStatusStatus.Value  = status;
          oleDbCommandURIStatus.ExecuteNonQuery();
          uriStatusGuid = new Guid( (oleDbParameterURIStatusGuid.Value).ToString() );
          System.Console.WriteLine
          (
           "URI: {0} | Dated: {1} | Status: {2} | Guid: {3}", 
           uri, 
           dated,
           status,
           uriStatusGuid
          );
          uri = AboutBlank;
          break;

         case NameKeyword: 
          keyword = nodeValue;
          oleDbParameterURIKeyword.Value  =  keyword;          
          break;

         case NameTitle: 
          title = nodeValue;
          oleDbParameterURITitle.Value    =  title;          
          break;

         case NameURI: 
          if ( nodeValue != string.Empty )
          {
           uri = nodeValue;
          } 
          oleDbParameterJehovahURI.Value   = uri;
          oleDbParameterURIURI.Value       = uri;
          oleDbParameterURIStatusURI.Value = uri;
          break;
        }//switch (nodeName) 	
       }//foreach (XmlNode xmlNodeAddressElement in xmlNodeAddress )
       
       if ( uri == AboutBlank ) { continue; }

       foreach ( OleDbParameter oleDbParameter in oleDbParameterCollectionURI )
       {
        System.Console.Write("{0}: {1}|", oleDbParameter, oleDbParameter.Value );
       }//foreach ( OleDbParameter oleDbParameter in oleDbParameterCollectionURI )
       System.Console.WriteLine();             
       oleDbCommandURI.ExecuteNonQuery();
       
      }//foreach ( XmlNode xmlNodeAddress in xmlNodeListAddress )
     }//for ( String URIImportFileNameCurrent in URIImportFileName )  

    //Close the database connection.
    UtilityDatabase.DatabaseConnectionHouseKeeping( oleDbConnection, ref exceptionMessage );

   }//try
   catch( OleDbException oleDbException )
   {
    exceptionMessage = UtilityEventLog.WriteEntryOleDbErrorCollection( oleDbException );
    System.Console.WriteLine("OleDbException: {0}", exceptionMessage);
   }//catch( OleDbException oleDbException )
   catch( IOException ioException )
   {
    System.Console.WriteLine("IOException: {0}", ioException.Message);
   }//catch( OleDbException oleDbException )
   catch( XPathException xPathException )
   {
     System.Console.WriteLine("XPathException: {0}", xPathException.Message );
   }//catch( XPathException xPathException )
   catch( XmlException xmlException )
   {
     System.Console.WriteLine("XMLException: {0}", xmlException.Message );
   }//catch( XmlException xmlException )
   catch( Exception exception )
   {
     System.Console.WriteLine("Exception: {0}", exception.Message );
   }//catch( Exception exception )
  }//URIImportFileName