Hi,
I was wondering what is the 'correct' way to log information messages; to files, or to a special log in the event viewer?
I like logging to files since I can use rolling flat file listener and see fresh new log from each day, plus in the event viewer I can only see one message at a time - where in a file I can scan through the day m...
I am looking for examples of configuration based validation using Validation Application Block. I've found this
I want to ask if someone has an alternative solution to using EL VAB 5.0 to achieve configuration based validation. I've started with DataAnnotations but soon found out that some properties will need different types of validat...
Hi All:
I already logged thrown exceptions to text file , now i want to log them to MS Sql database
but i couldn't find clear sample to perform this task.
...
Hi. I am using Dependency Injection pattern to resolve correct instance of mine UnitOfWork.
When I am using only one type mapping, all is ok
unityContainer.RegisterType<IUnitOfWork, UnitOfWork>();
The problem occurs when I am using two type mappings for the same interface:
unityContainer.RegisterType<IUnitOfWork, UnitOfWork1>(); ...
What I am trying to do is pass multiple parameters to Log.Write without first creating a long string of them with newline escape characters.
Here is my current function:
public static void LogPipedEvent(string message)
{
//Split message on double pipe escape "||"
string newmessage = "";
string[] splitMessage...
Hello, I beginning a new project and I need to create a Project for implementing Entity Framework 4.0 and Unity Framework 2.0 along with Enterprise Library 5.0.
I am very new to Entity Framework and Unity Framework and getting confused in how I can get normal Object BO's and DAL with Database.
Can someone point me to some simple exampl...
I'm using Microsoft.Practices.EnterpriseLibrary.Data.Database to create my accessors and execute my queries.
I'd like to know if there is anyway, within this scenario, to automatically log all queries and parameters that are being sent to the database.
...
I want to use Enterprise Library 5 and Unity to intercept calls made on some WCF Data Services. If I wanted to do this on a custom object I would have an IMyObject interface and a MyObject implementation. I would then include some config in my web.config along the lines of the following (I want to add performance counters in this instanc...
I am using Enterprise Library 5, set up the Database successfully but am now facing the following problem.
I have a stored procedure which is a simple select statement which returns 1 string (not an output parameter).
In code I wrote:
var result = _db.ExecuteSprocAccessor<string>("GetTypeOfPerson", mapper, parameters);
However this ...
I have a piece of code that I got from MSDN and I am not sure how do I reference this class?
It mentioned about Exception Management Application Block ... is this an old version of Ms Enterprise Library?
catch (Exception generalException)
{
ExceptionManager.LogException(generalException);
}
...
What an awkwardly worded question, you're thinking?
When my application loads, it goes to the database and gets several different lookup tables worth of data and creates .NET Lists for each one and puts them in cache. For example, "Status".
List at this point:
On,
Off
When I retrieve the List of Statuses from the cache, I add another...
I'm using MS Enterprise Logging Application Block in an ASP.NET website.
For production launch, I will set up a log listener in one of these locations:
Sql Server database
Windows event log
Text files
Which has the least impact on performance?
NB - I can't switch to Log4Net or ELMAH at this point, so please don't suggest that in yo...
Is it possible to use the selfvalidation attribute with my validations located in a metadatatype? I'm using Enterprise Library 5's Validation Application Block.
...
When using WCF together with Enterprise Library 5.0's validation application block, is it possible to customize the error messages which are sent back to the client?
I've added the ValidationBehaviour-attribute to my service contract and the FaultContract-attribute to the operation:
<ServiceContract()> _
<ValidationBehavior()> _
Public...
I have several stored procedures in my database. For example a delete stored procedure like:
alter procedure [dbo].[DeleteFactor]
@Id uniqueidentifier
as
begin
delete from Factors where Id = @Id
end
When I call this from code like this:
dc.ExecuteSprocAccessor("DeleteFactor", id);
then the row does not get deleted. However this...
I'm using the combination described on the title. If I use DataAnnotations the ErrorMessage I set is shown correctly on MVC 2 form validations. However if I switch the validation to Entlib 5, with the same ErrorMessage property set, the error message shown is a deafult one, depending on the validator, and not the one I set.
Before, work...
I am trying to set command timeout for enterprise library 4.1 data access. I used below code for get command object from Database.
Dim dbCom as System.Data.Common.DBCommand
dbCom = dbCon.GetDatabase.GetStoredProcCommand(sprocName, parameters)
dbCom.CommandTimeOut 'I dont find this property.
How to set CommandTimeout?
...
I need to validate two fields only if a third field has a specific value.
In this code snipper i suppose to use a CheckIf properties that not exist.
It is possible to validate a field only if another property hase a specifica value ?
public string CustomerType { get; set; } // P=Private B=Business
[NotNullValidator(MessageTemplate = "Y...
Hi
I have enterprise library 4.1 in a c# 3.0 app.
The database is SQL Server 2008.
I have created an entity class in the designer (based on base class 'ObjectContext').
In this entity there is a function that hooks into a stored procedure on the database. The stored procedure handles the insert of a record into a table. Nothing else.
The...
Hello,
For a project we are using Enterprise Library 5, and will be using several of the blocks. I'm inclined to use the Logging application block since its built into this framework. But I do see a lot of recommendations for log4net, so what have people chosen to do and if choosing log4net, why did you choose it over some of the othe...