Click here to Skip to main content
15,897,273 members

error in system.collections.generic.idictionary

gowthammanju asked:

Open original thread
when i am running following commands

C#
public abstract class ConnectionProvider : IConnectionProvider, IDisposable
   {
       private string connString;
       private IDriver driver;
       private bool _isAlreadyDisposed;

       protected virtual string ConnectionString
       {
           get
           {
               return this.connString;
           }
       }

       public IDriver Driver
       {
           get
           {
               return this.driver;
           }
       }

       static ConnectionProvider()
       {
       }

       ~ConnectionProvider()
       {
           this.Dispose(false);
       }

       public virtual void CloseConnection(IDbConnection conn)
       {
           try
           {
               conn.Close();
           }
           catch (Exception ex)
           {
               throw new ADOException("Could not close " + conn.GetType().ToString() + " connection", ex);
           }
       }

       public virtual void Configure(IDictionary settings)
       {
           this.connString = settings[(object)"hibernate.connection.connection_string"] as string;
           if (this.connString == null)
               this.connString = this.GetNamedConnectionString(settings);
           if (this.connString == null)
               throw new HibernateException("Could not find connection string setting (set hibernate.connection.connection_string or hibernate.connection.connection_string_name property)");
           this.ConfigureDriver(settings);
       }

       protected virtual string GetNamedConnectionString(IDictionary settings)
       {
           string index = settings[(object)"hibernate.connection.connection_string_name"] as string;
           if (index == null)
               return (string)null;
             ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings[index];
           if (connectionStringSettings == null)
               throw new HibernateException(string.Format("Could not find named connection string {0}", (object)index));
           else
               return connectionStringSettings.ConnectionString;
       }

       protected virtual void ConfigureDriver(IDictionary settings)
       {
           string name = settings[(object)"hibernate.connection.driver_class"] as string;
           if (name == null)
               throw new HibernateException("The hibernate.connection.driver_class must be specified in the NHibernate configuration section.");
           try
           {
               this.driver = (IDriver)Activator.CreateInstance(ReflectHelper.ClassForName(name));
               this.driver.Configure(settings); // error in these line
           }
           catch (Exception ex)
           {
               throw new HibernateException("Could not create the driver from " + name + ".", ex);
           }
       }

       public abstract IDbConnection GetConnection();

       public void Dispose()
       {
           this.Dispose(true);
       }

       protected virtual void Dispose(bool isDisposing)
       {
           if (this._isAlreadyDisposed)
               return;
           if (isDisposing)
           this._isAlreadyDisposed = true;
           GC.SuppressFinalize((object)this);
       }
   }


getting error as

best overload method match for nhibernate.driver.idriver.configure ( system.collections.generic.idictionary) has some invalid arguments

do not know where to i got struck

Waiting for your response
Tags: C#, .NET (.NET 1.0)

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900