enterprise-library

How to clear parameters from a Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase object?

I know you can add parameters , but how do you clear the parameters? ...

Implementing Log file using Enterprise Library in asp.net

I m using Microsoft Enterprise Library 3.1 for Exception Handling in asp.net, the erors are stored in Event Viewer of the system . Instead of Event Viewer I need to store these errors in a log File using Enterprise Library. Suggest some methods to implement it. Thanks in advance. ...

Set maximum life of entity in Enterprise library's cache block?

In my application I want to add some items to my cache, but these items should be at most one day old. Is there an OOTB way to set the maximum life for certain objects? ...

Enterprise Library Data Access Block Transaction Management Best Practice

What is the best practice for processing a batched series of CRUD operations in a single transaction with the Enterprise Library Data Access Block that it won't be esclated to a distributed transaction? Edit Full Source: public void BatchInsertEvents(IList<EventItem> events) { _dataAccessBase = new DataAccessBase("[dbo].[EventInser...

Log files with strange names (Enterprise Library)

I'm using Enterprise Library 3.1 for logging exception for some web application. All exception should be written to a single xml file (say Errors.xml) on the same server the application run. The problem that sometime in addition to Errors.xml I see files with names like this: 7b53e14b-4b92-43b5-94a0-09666f1c8c4c**ServerName**.xml where S...

How does one indicate the "default" connection string for Enterprise Library?

I hant to be able to call DatabaseFactory.CreateDatabase(), i.e. with no parameter to indicate which connection string to pull from my config file. I only have one connection string in my config file. The only help I have found on the internet is instructions to indicate the default connection string using the Enterprise Library Configur...

Helper for Enterprise Library version 4.1

Hi all, any helper class for reduce code lines using ent Library: Database db = DatabaseFactory.CreateDatabase("ConnectionStrings.Oracle.D04PES01"); using (DbCommand cm = db.GetStoredProcCommand("TBL_POC_TEST_TIPOS.TBL_POC_TEST_TIPOS_FBY_PK")) { db.AddInParameter(cm, "P_ID_TEST_TIPOS", DbType.String...

How to log WCF exception shielding's {Guid} in client

I'm using WCF Exception Shielding to map various exceptions to FaultContracts so I can limit what information I expose to the client. I had hoped to leverage the {Guid} mapping property so I could correlate client logs and server logs: <mappings> <add source="{Guid}" name="Id" /> <add source="{Message}" name="MessageText" /> </mapp...

Validate a Collection Has at Least One Item using Validation Application Block.

Using the Enterprise Library 4.1 Validation Application Block, how can I validate that a collection property contains at least one item? ...

Sending email with the MS Enterprise Library Logging Application Block via smtppickupfolder?

I like the MS Enterprise Library Logging Application Block because it lets me easily define a few logging settings and then log an error in a line or so of code from my application. However, I really want to be able to send email using my SMTP server's pickup folder (as opposed to specifying the servername and port). Just using the plai...

How to store diferent message formats in the same log file?

Hi everyone, im using Enterprise Library Logging Block for tracing messages in my application, and i want to write messages with the following templates, in the same log file: MESSAGE TEMPLATE 1: Timestamp: {timestamp} MessageType: {severity} Message: {message} appID: {keyvalue(Username)} MESSAGE TEMPLATE 2: Timestamp: {timestamp} Mess...

Database Trace Listener with Enterprise library 2.0 not logging in database

I am using Database TraceListener for logging. I've executed the CreateLoggingDb.cmd and the Logging Database is in place. My web.config looks like the below. When an excpetion occurs I try to log it as below. ExceptionPolicy.HandleException(ex, "PayrollException"); The code runs but it does not log in the database table. Please let ...

Deploy Microsoft Application Block in Shared Folder

Hi All, We are creating a shared libraries which is basically wrapper over the Microsoft Application Blocks (Caching, Logging etc). I am trying to make this library available to multiple ASP.Net application. This library is deployed in a shared foler. I have created a custom Container which will be used by all ASP.net application to...

Problem in reading connection string from App.Config when using NUnit 2.5.2

I'm using Microsoft Visual Studio 2005 with Enterprise Library 3.1. I have a data access layer which is a separate visual studio class library project. I wrote unit tests in a another class library and trying to call the data access method, but I keep getting PSMCP.Dal.Tests.DataManagerTests.GetAAAReturnsDataReader: System.NullReferen...

EntLibConfig.exe - change indentation on XML

The "EntLibConfig.exe" tool that comes with Microsoft Enterprise Library tends to reformat entire .config XML files after you change some of your settings in the GUI. With XML files, we have a coding standard of 4 space indentation, but EntLibConfig seems to use 2 spaces. Is there any way to configure this tool to customize how it inde...

Is it a good practice to create wrapper over 3rd party components like MS enterprise Library or Log4net?

Hi All, This is more like a good practise question. I want to offer different generic libraries like Logging, caching etc. There are lots of third party libraries like MS enterprise library, log4Net, NCache etc for these. I wanted to know if its a good practise to use these directly or create wrapper over each service and Use a DI to ...

Best way to take advantage of .NET 3.5

I currently have an asp.net web application which is using seperate assemblies for the data access, the business logic, entity objects, and the web user interface. The data access was created using Microsoft's Data Access Application Block compilied as a .NET 2.0 assembly. Stored procedures were used for the actual moving of data in and ...

How to Integrate Enterprise Library Validation Application Block ValidationResults between WCF and ASP.NET?

Enterprise Library Validation Application Block (VAB) integrates with ASP.NET and also with WCF. Is there a way to integrate ValidationResults created in WCF with ASP.NET? e.g. an ASP.NET web page invokes a WCF service. The WCF service validates the data using VAB and returns validation information via a FaultContract. The ASP.NE...

Purpose of Unity Application Block in Microsoft Enterprise Library?

Can someone explain to me what is the purpose of the Unity Application Block? I tried looking through the documentation but its all very abstract. What are some practical uses for the Unity block? ...

Have log entries forced to a single line when using p&p EntLib logging block

I am using the patterns & practices enterprise library (p&p EntLib) logging block to write to a text file. Some of the log message contain multiple lines which I would like to force to become a single line - in other words replacing the \r & \n with a space in the log messages prior to them being written to the file. How do I configur...