473,729 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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= 7c307b91aa13d20 8" %>

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= 7c307b91aa13d20 8" %>
<%@ Import Namespace="IBM. Data.DB2" %>
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SqlClie nt" %>
<%@ Import Namespace="Syst em.IO" %>

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

<script runat="server">

void linkConnect_Cli ck(object sender, EventArgs e)
{
String cs = "Server=192.168 .1.160:446; " +
"Database=S104V DNM; " +
"UID=QSECOF R; PWD=xyz;";
DB2Connection conn = new DB2Connection(c s);
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.DllNotFo undException: Unable to load DLL
'db2app.dll'.

Stack Trace:

[DllNotFoundExce ption: Unable to load DLL 'db2app.dll'.]
IBM.Data.DB2.v. nmpTraceOn() +0
IBM.Data.DB2.v. e() +97
IBM.Data.DB2.DB 2ConnPool.d() +324
IBM.Data.DB2.DB 2ConnPool..ctor () +21
IBM.Data.DB2.DB 2Connection..cc tor() +67

Nov 12 '05 #1
3 15523
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= 7c307b91aa13d20 8" %>

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
6404
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 to happen we had to change the context in which asp.net runs from machine to SYSTEM by modifying the machine.config file. Under Windows 2003 no matter how asp.net is set to run as either machine or system. I get the following error: ...
1
3099
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 advance Andy
1
3609
by: Mauro Miotello | last post by:
Someone are using successfully, VS.Studio 2003 on Windows 2003 with DB2 8.2.2 ? Mauro
1
4472
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 could not be located in the dynamic link library DB2APP.dll java.exe Entry Point not found
0
2171
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 .aspx file I get an error: Unable to load DLL 'db2app.dll'. Exception Details: System.DllNotFoundException: Unable to load DLL 'db2app.dll'. with the help of this list I am using the @assembly directive to
1
3536
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 remote site is trusted. Also, my web site uses a custom HTTPModule implemented in a DLL named Security.dll. Unable to find an entry point named EnumerateSecurityPackagesW in DLL security.dll. Description: An unhandled exception occurred during...
4
5567
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 Help!
4
12603
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 run the exe it reports the following strange message: --------------------------- myapp.exe - Unable To Locate Component --------------------------- This application has failed to start because MSVCP80D.dll was not found.
3
5549
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 memory and unable to find a dll - webengine.dll. They have tried rebooting, gettling latest, and a few other things. We can not determine what is at the heart of this problem. They have Visual Studio.Net 2005 with .Net Framework 2.0 SP1. The...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8148
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.