locked
Format of the initialization string does not conform to specification starting at index 117. RRS feed

  • Question

  • User395413141 posted

    Hi All,

    I am getting the following Error when i try to Run a Stored Procedure. I am using Enterprise Library.

    App.Config

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
     <configSections>
      <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
     </configSections>
    
     <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
      defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
      <listeners>
       <add fileName="CarnetLog.log" header="----------------------------------------"
        footer="----------------------------------------" formatter="Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="FlatFile TraceListener" />
       <add source="Enterprise Library Logging" formatter="Text Formatter"
        log="Application" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Formatted EventLog TraceListener" />
      </listeners>
      <formatters>
       <add template="Timestamp: {timestamp(local)}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
      </formatters>
      <categorySources>
       <add switchValue="All" name="Errors">
        <listeners>
         <add name="FlatFile TraceListener" />
        </listeners>
       </add>
       <add switchValue="All" name="Debugging">
        <listeners>
         <add name="FlatFile TraceListener" />
        </listeners>
       </add>
       <add switchValue="All" name="General">
        <listeners>
         <add name="FlatFile TraceListener" />
        </listeners>
       </add>
      </categorySources>
      <specialSources>
       <allEvents switchValue="All" name="All Events" />
       <notProcessed switchValue="All" name="Unprocessed Category" />
       <errors switchValue="All" name="Logging Errors &amp; Warnings">
        <listeners>
         <add name="Formatted EventLog TraceListener" />
        </listeners>
       </errors>
      </specialSources>
     </loggingConfiguration>
     <connectionStrings>
      <add name="Carnet" connectionString="Data Source=NIBC1009\SQL2008;Initial Catalog=GlassLookUp;Persist Security Info=True;User ID=saforglass;Password=nous;123"
        providerName="System.Data.SqlClient" />
     </connectionStrings>
    
     <appSettings>
      <add key="FileLocation" value="D:\CarNet\FileManupilator\FileMaupilatorDoc"/>
      <add key="HistoryLocation" value="D:\CarNet\FileManupilator\FileMaupilatorArchive"/>
      <add key="ErrorLogLocation" value="D:\CarNet\FileManupilator\FileMaupilatorErrorLog"/>  
     </appSettings>
    </configuration>
    

     

    And here is the Method where i am Executing it,

     

    public static void ExecuteStoredProcedure(string procedureName, List<SqlParameter> parameters)
        {
          try
          {
            var database = DatabaseFactory.CreateDatabase("Carnet");
            var dbCommand = database.GetStoredProcCommand(procedureName);
            if (parameters != null)
            {
              foreach (var parameter in parameters)
              {
                dbCommand.Parameters.Add(parameter);
              }
            }
            database.ExecuteNonQuery(dbCommand);
          }
          catch (Exception exception)
          {
            Utility.Log(exception.Message + "\n" + exception.InnerException, "", Utility.Category.Errors);
          }
        }
    

     

    I am getting the Error when it comes to..

    database.ExecuteNonQuery(dbCommand);

    Wednesday, March 16, 2011 8:34 AM

All replies

  • User1795492109 posted

    Hi,

    I get a feeling that you should look in the parameters you are passing as list to the method since there might be chances that the way parameters have been named or data types have been defined and the value that is being passed for that particular data type.

    Regards,
    AJ 

    Sunday, September 11, 2011 7:13 AM