Classic ASP with Enterprise Library -Data Block.

Topics: Data Access Application Block
Mar 12, 2008 at 7:34 AM
Edited Mar 12, 2008 at 11:52 AM
Heres the scenario...

An ASP Page calls a c# component registered using regasm /tlb seehash.dll

I know the registration of the dll has gone fine because for testing purposes the dll just returned a simple string 'IamSeeHash' which got displayed on the asp page. Then I went back to my seehash.dll, uncommented the following line
Database db = DatabaseFactory.CreateDatabase();
and recompiled the dll and re-registered it again.

now I get the error 'Object reference not set to an instance of an object.'

I figure this could be because the config file cant be located by the asp process, so I created a copy of the config files in the SystemRoot%\System32 directory as 'dllhost.exe.config' and also 'asp.dll.config'
another copy named as 'index.asp.config' in the asp pages root directory. still I get the same error

I even went back to my seehash.dll and modified the line to add the specific database name
Database db = DatabaseFactory.CreateDatabase("MyDb");
then it says 'The requested database MyDb is not defined in configuration.'

What is going wrong? Please help.


+Heres my config file +

Microsoft.Practices.EnterpriseLibrary.Data" />

UID=sa;PWD=usa;" />

<dataConfiguration defaultDatabase="MyDb"/>

+Heres my folder structure +

For the asp page

For the dlls (all referenced dlls of the datablock are in this directory)