Saturday, February 25, 2012

Data Acess aplication block

Hi
I have Microsoft Enterprise Library 2005 installed on my local system.
I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
Server 2000.
I am developing a web application in which i am using data Access
Application Block for data access.
I have a remote web n data server with asp.net 1.1 support
the application is working fine here on the local server(web & data).
when i change the data server path to the remote server it also working
fine but
When I uploaded the application on the remote server n tested there it
gives me the following err
ex.message was
>>The type initializer for
>>"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent"
>>threw an exception.
ex.Source was
.........Microsoft.Practices.EnterpriseLibrary.Data
ex.trace was
at
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
command) at property.m4.Button2_Click(Object sender, EventArgs e)
Plz help me why this is happening.........
Mukesh Kumar agarwal
Delhi
IndiaMukesh,
Are you sure that the user that ASP.NET is running under has access to
the database you are trying to reach? It seems as if this is an error on
connecting.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@.spam.guard.caspershouse.com
"Mukesh" <efextra@.newsgroups.nospam> wrote in message
news:u6JBICB1GHA.4264@.TK2MSFTNGP05.phx.gbl...
> Hi
> I have Microsoft Enterprise Library 2005 installed on my local system.
> I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
> Server 2000.
> I am developing a web application in which i am using data Access
> Application Block for data access.
> I have a remote web n data server with asp.net 1.1 support
> the application is working fine here on the local server(web & data).
> when i change the data server path to the remote server it also working
> fine but
> When I uploaded the application on the remote server n tested there it
> gives me the following err
>
> ex.message was
>
> >>The type initializer for
> >>"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent"
> >>threw an exception.
> ex.Source was
> .........Microsoft.Practices.EnterpriseLibrary.Data
> ex.trace was
> at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
> command) at property.m4.Button2_Click(Object sender, EventArgs e)
>
> Plz help me why this is happening.........
> Mukesh Kumar agarwal
> Delhi
> India
>
>
>|||The error you are getting is because the enterprise library wants to write
events to the event log and setting this up requires registry permissions.
You need to installutil the dlls for the enterprise library (this is covered
in the docs somewhere). The reason it is writing to the event log is because
the connection failed. If you setup the event log access correctly then you
will have an eventlog entry telling you why the connection failed.
HTH
Ciaran O'Donnell
"Mukesh" wrote:
> Hi
> I have Microsoft Enterprise Library 2005 installed on my local system.
> I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
> Server 2000.
> I am developing a web application in which i am using data Access
> Application Block for data access.
> I have a remote web n data server with asp.net 1.1 support
> the application is working fine here on the local server(web & data).
> when i change the data server path to the remote server it also working
> fine but
> When I uploaded the application on the remote server n tested there it
> gives me the following err
>
> ex.message was
>
> >>The type initializer for
> >>"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent"
> >>threw an exception.
> ex.Source was
> ..........Microsoft.Practices.EnterpriseLibrary.Data
> ex.trace was
> at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
> command) at property.m4.Button2_Click(Object sender, EventArgs e)
>
> Plz help me why this is happening.........
> Mukesh Kumar agarwal
> Delhi
> India
>
>
>|||Hi all
As per my earlier conversation with Ciaran (thx for reply) I have
installed the MS APplication block on the server , when i ran Build
Enterprise Library file and Install Services from (batch files )
programme files menu it was asking for visual studio 2003 , I have only
.net framework on the server how can i use the MS application block
data access library on my server plz help...
Mukesh Agarwal
mukesh.nitb@.gmail.com
Delhi India
Ciaran O''Donnell wrote:
> The error you are getting is because the enterprise library wants to write
> events to the event log and setting this up requires registry permissions.
> You need to installutil the dlls for the enterprise library (this is covered
> in the docs somewhere). The reason it is writing to the event log is because
> the connection failed. If you setup the event log access correctly then you
> will have an eventlog entry telling you why the connection failed.
> HTH
> Ciaran O'Donnell
> "Mukesh" wrote:
>> Hi
>> I have Microsoft Enterprise Library 2005 installed on my local system.
>> I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
>> Server 2000.
>> I am developing a web application in which i am using data Access
>> Application Block for data access.
>> I have a remote web n data server with asp.net 1.1 support
>> the application is working fine here on the local server(web & data).
>> when i change the data server path to the remote server it also working
>> fine but
>> When I uploaded the application on the remote server n tested there it
>> gives me the following err
>>
>> ex.message was
>>
>> >>The type initializer for
>> >>"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent"
>> >>threw an exception.
>> ex.Source was
>> ..........Microsoft.Practices.EnterpriseLibrary.Data
>> ex.trace was
>> at
>> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
>> connectionString) at
>> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
>> connectionString) at
>> Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
>> Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
>> command) at property.m4.Button2_Click(Object sender, EventArgs e)
>>
>> Plz help me why this is happening.........
>> Mukesh Kumar agarwal
>> Delhi
>> India
>>
>>
>>|||Hello Mukesh,
As for the installation of instrumentation servcie of enterprise library
2005, I've posted some information from the enterprise lib's product
team(in your another duplicated thread in the
microsoft.public.dotnet.languages.csharp newsgroup) which include:
** how disable instrumentation of enterprise library (through custom build)
when deploy them to product environment.
** how to install the instrumentation services without vs 2003
installed(use the installUtil.exe in .net framework utilities):
For your convenience, I've pasted my reply in that thread below:
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
=============================================Hi Mukesh,
As for the Enterprise Library(2005) for .net framework 1.1, the
instrumentation services does need to be installed separately. And the
"install services" bat file does require the VS 2003 IDE installed on the
machine. Actually this is because instrumetation feature is mainly used in
development environment. For production environment, generally we do not
use them and can disable the setting at compilation time(through some build
flags).
Therefore, for your scenario, you can consider the following options:
1. Build a product version of the enterprise library which disable the
instrumentation in the build options(some conditional compile variables).
2. Instead of using the "Install Services" bat file, use the
InstallUtil.exe utility(shipped with .net framework 1.1 rather than vs
2003) to register the instrumentation service against each enterprise
library assembly (you will use in your application).
Here is a blog article from the product manager of enterprise library
(pattern&practice team) which has provide a complete description on the
instrumentation services of Enterprise library 2005(.net 1.1) and how to
disable it in custom build or install the service without VS 2003 IDE:
#Instrumentation in Enterprise Library
http://blogs.msdn.com/tomholl/archive/2005/02/18/376187.aspx
Hope this helps.
Sincerely,
Steven Cheng
===============================================================

No comments:

Post a Comment