473,241 Members | 1,605 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,241 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 15375
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: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.