enterprise-library

Advantages and disadvantages of using Enterprise Library

Im just starting a project and since this project is personal I was wondering what are the advantages of using Enterprise Library? We use the version 2 for several projects in the office but im not quite sure (aside of the good practices) of the advantages of it, especially in the database component. Any advice? Thanks ...

SQL custom functions in Enterprise Library

Is there a way to execute SQL custom functions with Enterpise Library? I've tried Database.ExecuteScalar() but for some reason it returns null. This is my function: Database db = DatabaseFactory.CreateDatabase("ConnectionString"); DbCommand cmd = db.GetStoredProcCommand("FunctionName"); db.AddInParameter(cmd, "Value1", DbType.String, P...

MySQL and SQL Server for same application.

What are good ways of achieving this DB agnosticism without actually coding two DAL's? I've heard that the Data Access Application Block is suitable for this. ...

MySQL Caching

Last night I added a parameter to a stored procedure in a mySQL database. I accessed it, messed up the parameter, and decided to remove the parameter again, for testing. Still minutes after re-creating the procedure without the parameter, my command object was still complaining about a missing parameter. Is this mySQL, MySQL/Connector...

How to Pass MySQL null parameter on DbCommand in Enterprise Library.

I'm trying to pass a null value for the first parameter in the code below, but MySQL complains that Incorrect number of arguments for PROCEDURE myProc; expected 2, got 1 When I manually call the procedure with the first argument as null, it works, but when EmptyAsNullStartsWith(employeeNumberText.Text) returns null, it complains. ...

Enterprise Library 4: logging block flat file

I am having problem creating log entry to a text file. Here is my logging configuration in my ASP.net app. and here is my vb.net code Try ...

Does Fluent-NHibernate support mapping to procedures?

I've been wondering if it's possible to have Fluent-NHibernate communicate with stored procedures that already exist and assign mapping from the result set to my own domain objects. Also is Fluent-NHibernate able to directly execute procedures with no result set returned? Basically I've been considering the implications of using Fluent...

Separate configuration file for MS Enterprise Library

I have a section on my ASP.net web.config for the Enterprise library logging block. Is it possible to separate the logging configuration into another configuration file? How do I do that? ...

Logging using policy injection application block

Hi All I want to ask, how to use policy injection application block to log methods entry and exit in these cases : Case1 : in case of logging events handlers of a web form controls, you know the class let's say _Default must be inherited from class System.Web.UI.Page , so we can't inherit our class from MarshalByRefObject class so log...

Enterprise Library 4.1 Configuration

So I've followed the blog post here to try and hold my enterprise library configuration in a separate config file. Specifically I'm trying to keep my connection strings there. In the Enterprise Library Config Editor I see the connection strings I'm supposed to see however this run time code foreach (ConnectionStringSettings c in Confi...

Changing connection string at runtime in Enterprise Library

Is there a way to change the connection string of a DataBase object in Enterprise Library at runtime? I've found this link but its a little bit outdated (2005) I've also found this but it seems to apply to .Net in general, I was wondering if there was something that could be done specifically for EntLib. I was just passing the connecti...

Statistics engine for Java EE Web Application

We are working on a Java EE Web Application, and the people from marketing need some really detailed stats for our site. Something similar to Google Analytics, gathering the user's information, and their navigation through the site (where they come from, what they click, where they go, etc.). Depending on a third party service like Anal...

How to use enterprise library logging in a .NET custom action

I have some library code which is used from my application and is also used by a .NET custom action in a Visual Studio installer project. The library code in turn uses the Enterprise Library logging block to do its logging. How can I get configuration information to the Enterprise Library in the context of my custom action running insi...

How do I create a custom validator in VAB that tests two properties at once?

Hi In my database, I have a composite unique key constraint (CustomerId, Name) on a entity. I want to test if the unique constraint is upheld before submitting changes to the database. The user can customize the Name attribute on the entity, so I would like to make a custom validator that validates the name property, but while doing it,...

Enterprise Library Logging: TraceListeners Question.

Is it possible to log certain events to -> event log for example, while others to -> file trace listener, while others still to -> SQL database. I want to be able to configure this somewhere so errors go to text, verbose information goes to SQL, and warnings go to (event viewer and text). Is this type of thing possible? ...

System.IO.FileLoadException

Hi All, I have got this error when using Enterprise Library 3.1 May 2007 version. We are developing a product and have a common lib directory beneath the Subversion Trunk directory <>\Trunk\Lib\ into which we put all the third party DLLs. Inside this we have Microsoft\EnterpriseLibrary\v3.1 in which we have copied all the dlls from ...

Example sql for logging exceptions to database using exception handling application block

Can anyone provide (or point me to) example sql code for logging exceptions using Enterprise Library Exception Handling Application Block (EHAB)? ie I'd like standard CREATE TABLE and CREATE PROCEDURE statements for the structures and procs to store logged exceptions in a SQL Server database. Also, can anyone describe how the app block ...

DAAB, the best approach to use Database instances is ...

Guys, I am going to use Enterprise Library (4.1) and especially DAAB. Here is I have questions: What is the best approach and why: Every time when I need to run a DbCommand I create Database instance using DatabaseFactory.CreateDatabase(); I have a base class with instanced Database (using the same CreateDatabase() static method) and...

Entlib and interop: does it work, and where does the config file go?

I'm trying to use the EntLib 3.1 within .net code for a dll which is registered for COM interop. Where do I put the config file? Alternatively, is there a way to specify within the dll code where it should get the entlib config from? Since my dll will be called from COM I don't always know what exe will be calling it. I created a simp...

Are there any good OSS instances of converting an Exception to HTML (C#) ?

Working with EntLib 4.1 and want the Exception block to send an email with error information. All that is fine but out of the box I have either the Text or Xml formatter to work with. I would love an Html representation that which brings in other information such as browser, http headers etc. Years ago I wrote one but dont have the sourc...