Error:Data source name not found and no default driver specified

Padmanabhan, Venkatesh 120 Reputation points


I am trying to connect to IBM DB2 database from my c# web application.

I have added the IBM.Data.db2.iSeries from the Manage nuget package, which in turn added the in the reference. I added the connection string in web.config as below, and i tried 2 ways to open the database, but getting error as :

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I have checked :

How to fix this ? How to connect to the DB2 database.

		<add name="dbconnection" connectionString="Database=DBNAMe;Hostname=hostname;Port=xxx;Uid=user id;Pwd=password;" />

Method 1:
  string constr = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;
                using (OdbcConnection odbcConnection = new OdbcConnection(constr))

Method 2:
using (iDB2Connection con = new iDB2Connection(constr))
A set of technologies in the .NET Framework for building web applications and XML web services.
3,232 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,159 questions
{count} votes