473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

unable to load dll db2app.dll . Error using DB2 in ASP.NET application.

I have installed the trial of db2 enterprise server on my w2k PC. Have
also installed fix pack 8 of that product.

I am using it to connect from an asp.net web page to an IBM as400. the
400 is at v5r1.
From the db2 command line shell I am able to connect to the as400

database.

The error I am getting is:
Unable to load DLL 'db2app.dll'.

The details of the error are below. Also below is my asp.net web page
code.

I am not using Visual Studio to code my page, so I did not add a
reference to the DB2 .NET namespace in the normal way. I am using the
assembly directive:
<%@ Assembly Name="IBM.Data.DB2, Culture=neutral,
Version=8.1.2.1, PublicKeyToken=7c307b91aa13d208" %>

Any idea why the db2app.dll is not found? It is on my system, in the
sqllib/bin directory.

thanks,
-Steve
Here is my asp.net web page code:

<%@ Page Language="C#" Trace=true %>
<%@ Assembly Name="IBM.Data.DB2, Culture=neutral,
Version=8.1.2.1, PublicKeyToken=7c307b91aa13d208" %>
<%@ Import Namespace="IBM.Data.DB2" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.IO" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">

void linkConnect_Click(object sender, EventArgs e)
{
String cs = "Server=192.168.1.160:446; " +
"Database=S104VDNM; " +
"UID=QSECOFR; PWD=xyz;";
DB2Connection conn = new DB2Connection(cs);
conn.Open();
conn.Close();
}

Here is the error message:

Unable to load DLL 'db2app.dll'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.DllNotFoundException: Unable to load DLL
'db2app.dll'.

Stack Trace:

[DllNotFoundException: Unable to load DLL 'db2app.dll'.]
IBM.Data.DB2.v.nmpTraceOn() +0
IBM.Data.DB2.v.e() +97
IBM.Data.DB2.DB2ConnPool.d() +324
IBM.Data.DB2.DB2ConnPool..ctor() +21
IBM.Data.DB2.DB2Connection..cctor() +67

Nov 12 '05 #1
3 15425
did you initalize command line enviroment for both visual stuido and
db2?

Nov 12 '05 #2

shiggy wrote:
did you initalize command line enviroment for both visual stuido and
db2?


just did that and I got the same results ( sad face )
Unable to load DLL 'db2app.dll'.

I am not going the standard Visual Studio, add a reference route. I am
using the freebie Visual Studio Developer Express from Microsoft. And I
cant figure out how to add references, so I was told to look in the GAC
( the /WINNT/Assembly directory ) and retrieve the PublicKeyToken and
Version of the DB2 assembly. I then specify those values in an
"@Assembly" directive at the top of the .aspx file.

<%@ Assembly Name="IBM.Data.DB2, Culture=neutral,
Version=8.1.2.1, PublicKeyToken=7c307b91aa13d208" %>

I dont think there is anything wrong with this approach. I actually
prefer the manual step instead of relying on GUI magic. But there is a
lot I dont know, so I dont know if refering to an assembly this way is
ok or not.

thanks,

-Steve

Nov 12 '05 #3
This issue ended up being caused by two problems. The first was that
DB2Connection was not part of the db2 trial that I had downloaded. I
was
told to use the Enterprise Server for Windows. The 2nd problem was due
to
the user ( ASPNET ) that the IIS server on my PC runs as not having
authority to files in the DB2 directory.

This was the trace that the IBM support tech had me run that identified
the authority problem:
db2trc on -f trace.dmp
<reproduce the problem-try to connect from ASP .NET>
db2trc off

-Steve

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
1
by: Andy Meyer | last post by:
Hi all, I try to execute the "sqledrpd" - Api. I found it in the db2app.dll renamed to sqledrpd_api, but my application crashes. Here's the codesnippset. Perhaps someone can help?! Thanks in...
1
by: Mauro Miotello | last post by:
Someone are using successfully, VS.Studio 2003 on Windows 2003 with DB2 8.2.2 ? Mauro
1
by: Sanju | last post by:
Hi.. I have working on Windows XP Operating System.Installed J2sdk 1.4.07 and installed IBM DB2 UDB version 8.1 Then i got the following error.. The procedure entry point SQLPrepareW@12...
0
by: Steve Richter | last post by:
I am trying, really trying to use the DB2Connection class provided by IBM to connect to a database on my old reliable as400 from the asp.net web page. When I run the DB2Connection code in my...
1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
4
by: Kuldeep | last post by:
Hi All, ..NET Framework - 1.0 ASP.NET Everytime I open my open, I get this error message "Unable to load one or more breakpoints" Even after this, I can build my application and run Please...
4
by: Abubakar | last post by:
Hi, I'm using vs2k5 vc++ (native/unmanaged). I just took a separate copy of a project from source control (vss) and after fixing its dependencies build it and it builds fine. But when I try to...
3
by: =?Utf-8?B?TGV3aXMgTW90ZW4=?= | last post by:
Hello. We are having a problem here trying to compile C# applications. Only one developer has a problem where they attempt to compile the application and the compiler complains about being out of...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.