.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

EnterpriseLibrary Version 5.0: how to prevent logging extra data

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net
 

Using Microsoft.Practices.EnterpriseLibrary Version 5.0.

How to stop writing the below into the log file , I am using "Rolling Flat File Trace Listener"

Category:

Priority:

EventId:

Severity:

Title:

Machine:

App Domain:

ProcessId:

Process Name:

Thread Name:

Win32 ThreadId:

Extended Properties:

I am using the below Text formatter:

<formatters> 
 
 
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
 
   
template="Local Timestamp: {timestamp(local)}{newline}&#xA;Message: {message}{newline}&#xA;" 
 
   
name=


View Complete Post


More Related Resource Links

Data Truncation issue with Enterprise Library Logging WriteLog stored Proc

  

Hi ,

I'm using Enterprise Library Logging  feature for logging. The issue i am facing is when the Logging message is too large(more than 65534 chars) ,complete data  is not logged in the Formatted Mesage column which is  of data Type nText .

I am able insert complete data if i try inserting from Sql insert Query from sql management studio. Do i need to add any attributes to data base listener or do i need to change the sp.

 Is there any way to increase the WriteLog stored proc param size in EnterpriseLibrary.Logging config file ? . Please let me know.

 

Thanks In Advance.


XML in Yukon: New Version Showcases Native XML Type and Advanced Data Handling

  

The next version of Microsoft SQL Server, code-named "Yukon," represents quite a few steps forward in the evolution of XML integration. Yukon supports native storage of XML data using the XML data type, which makes it possible to run native queries on XML data using the emerging industry standard XQuery language. Data integrity of the XML data type can be enforced through schema validation and XML-based check constraints, and special indexes can be defined that help speed up queries. In addition, Yukon has the built-in ability to expose its data through Web services. This article discusses these and other XML features of Yukon.

Bob Beauchemin

MSDN Magazine February 2004


SQL Server CE: New Version Lets You Store and Update Data on Handheld Devices

  

Handheld device users need to be able to synchronize with a main data store when it's convenient and, preferably, when the back-end database server isn't busy. SQL Server 2000 Windows CE Edition allows you to build a traveling data store that can be displayed and run on a variety of devices. SQL Server CE supports a subset of the full SQL Server package, and can be used as a standalone server or in tandem with SWL Server and IIS. The architecture of SQL Server CE, along with data manipulation, synchronization, and connectivity issues, are discussed in this article. Topics such as making your data public, choosing the right type of replication, and handling errors are also covered.

Paul Yao and David Durant

MSDN Magazine June 2001


The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database

  

Hello everybody,

 

i am encountering an exception in my in my application at these lines of code.

 

DatabaseProviderFactory dbFactory =

new DatabaseProviderFactory(dataSource);// Create and return a database object.

 

return dbFactory.Create(name);

 

i am getting this exception at the create line

 

The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, 125ba2c1-9573-45be-b8a2-b370deff980d]) failed: Exception has been thrown by the target of an invocation. (Strategy type ConfiguredObjectStrategy, index 2)

 

I have referenced the proper assemblies in my project and on  other systems, its working fine.

The connection string is DB2.My db2 connection is also good with no issues. My stack Trace

To prevent possible data loss before loading the designer, the following errors must be resolved: In

  
To prevent possible data loss before loading the designer, the following errors must be resolved: The class Form can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again. Instances of this error (1) 1. Hide Call Stack at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host) Thanks! This post is from Matthew Cenance.

Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging .. can not be resolved.

  
Hi everyone and I would like to thank in advance for any help related to the problem I am having.We are trying to move a legacy aplication from framework 2 to 4, and one of the components that is moving forward as well is the Enterprise Library.  Unfortunatly it i s th eonly thing that gives us a lots of grief....  To ilustrate the problem, I wrote a small sample.  Here is the code.using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.Common; using Microsoft.Practices.EnterpriseLibrary.Data; using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling; using Microsoft.Practices.EnterpriseLibrary.Logging; using Microsoft.Practices.EnterpriseLibrary.Common; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Label2.Text = "Enter Parameter"; Button1.Text = "Go"; TextBox1.Text = String.Empty; TextBox2.Text = "1"; } protected void Button1_Click(object sender, EventArgs e) { DataSet ds = null; DbCommand dbCommand = null; Database db = null; int num = 0; int.TryParse(TextBox2.Text, out num); try { db = DatabaseFactory.CreateDatabase(); dbCommand = db.GetStoredProcCommand("dbo.sps_HierarchyLev

File or Assembly Name 'System.Data.SqlServerCe,Version=3.5.0.0,Culture=neutral,PublicToken=3BE235DF

  
I have Encountered with this problem when i am doing project for mobile application. I have installed sqlce.dev.ENU.ppc.wce5.armv4i.CAB,sqlce.repl.wce5.armv4i.CAB,sqlce.wce5.armv4i.CAB,NETCFv2.wm.armv4i.cab My Deployment Cab File NewBatchScanCab_Data.CAB with all this following cab's. This Cab is running in another Computer's also but it is prompting error message as below: File or Assembly Name 'System.Data.SqlServerCe,Version=3.5.0.0,Culture=neutral,PublicToken=3BE235DF1C8D2AD3',or one of its dependencies,was not found. I Wanna now why it is prompting this error message.

File or Assembly Name 'System.Data.SqlServerCe,Version=3.5.0.0,Culture=neutral,PublicToken=3BE235DF

  
I have Encountered with this problem when i am doing project for mobile application. I have installed sqlce.dev.ENU.ppc.wce5.armv4i.CAB,sqlce.repl.wce5.armv4i.CAB,sqlce.wce5.armv4i.CAB,NETCFv2.wm.armv4i.cab My Deployment Cab File NewBatchScanCab_Data.CAB with all this following cab's. This Cab is running in another Computer's also but it is prompting error message as below: File or Assembly Name 'System.Data.SqlServerCe,Version=3.5.0.0,Culture=neutral,PublicToken=3BE235DF1C8D2AD3',or one of its dependencies,was not found. I Wanna now why it is prompting this error message.

Cannot create/shadow copy 'Microsoft.Practices.EnterpriseLibrary.Data' when that file already exis

  
Lately I am getting this error when compiling my application. Does anybody have an idea what is going wrong??? Cannot create/shadow copy 'Microsoft.Practices.EnterpriseLibrary.Data' when that file already exists. === Pre-bind state information ===LOG: User = DREAMCATCHER\BischiLOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Data Calling assembly : (Unknown).===LOG: This bind starts in default load context.LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/shareyourlossweb/887ea9ec/383e808e/Microsoft.Practices.EnterpriseLibrary.Data.DLL.LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/shareyourlossweb/887ea9ec/383e808e/Microsoft.Practices.EnterpriseLibrary.Data/Microsoft.Practices.EnterpriseLibrary.Data.DLL.LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).ERR: Failed to complete setup of assembly (hr = 0x800700b7). Probing t

Data Transfer in C# slow when targeting SQL Server 2005 using SQL Server SMO version 10 (distributed

  

 

Hello everyone,

I have a strange issue regarding SQL Server SMO Transfer. I am using the Transfer class to create a copy of a database. I will explain the different cases I have tried so far and maybe someone can help me figure out what's going on.

First case

I run my C# code from an assembly that references version 9.0.242.0 of SMO assemblies that are in my GAC

  • Microsoft.SqlServer.ConnectionInfo
  • Microsoft.SqlServer.Smo
  • Microsoft.SqlServer.SqlEnum

If I target a database hosted on a Sql Server 2005 database engine, it works perfectly and fast.

But of course, as soon as I try to target a Sql Server 2008 database engine, it complains that it is not compatible. No surprise there.

 

Second case

I run the exact same C# code from an assembly that references version 10.0.0.0 of SMO assemblies that are also present in my GAC

  • Microsoft.SqlServer.ConnectionInfo
  • Microsoft.SqlServer.Management.Sdk.Sfc
  • Microsoft.SqlServer.Smo
  • Microsoft.SqlServer.Smo.Extended
  • Microsoft.SqlServer.SqlEnum

If I target a database hosted on a Sql Server 2008 database engine, it works perfectly and fast.

However, if I try to target the sam

Data Transfer in C# slow when targeting SQL Server 2005 using SQL Server SMO version 10 (distributed

  

 

Hello everyone,

I have a strange issue regarding SQL Server SMO Transfer. I am using the Transfer class to create a copy of a database. I will explain the different cases I have tried so far and maybe someone can help me figure out what's going on.

First case

I run my C# code from an assembly that references version 9.0.242.0 of SMO assemblies that are in my GAC

  • Microsoft.SqlServer.ConnectionInfo
  • Microsoft.SqlServer.Smo
  • Microsoft.SqlServer.SqlEnum

If I target a database hosted on a Sql Server 2005 database engine, it works perfectly and fast.

But of course, as soon as I try to target a Sql Server 2008 database engine, it complains that it is not compatible. No surprise there.

 

Second case

I run the exact same C# code from an assembly that references version 10.0.0.0 of SMO assemblies that are also present in my GAC

  • Microsoft.SqlServer.ConnectionInfo
  • Microsoft.SqlServer.Management.Sdk.Sfc
  • Microsoft.SqlServer.Smo
  • Microsoft.SqlServer.Smo.Extended
  • Microsoft.SqlServer.SqlEnum

If I target a database hosted on a Sql Server 2008 database engine, it works perfectly and fast.

However, if I try to target the sam

Problem with getting extra data in column of gridview

  

I have created a gridview based on an SQL Datasource.  The grid view contains several columns(fields) one of which is called "Amount".  In the footer of the gridview their is a field that contains the sum of all of the values contained in the "Amount" field.

By problem is that in instead of getting the value of the Amount displayed in the "Amount" field of each row, I am getting a '0' (Example: 0 25.78 when I should just be getting 25.78.  There is a space between the '0' and the '25.78'.

Code is as follows:

 

<asp:TemplateField HeaderText="Amount" SortExpression="Amount">

system.io.fileloadexception - could not load file or assembly system.data.sqlserverce version=3.5.1.

  

 

my application raises this exception but the file system.data.sqlserverce.dll is in the folder of the application, and the version is correct.

 

do u have any idea about this problem ?

 

thanks in advance for every answer Smile

 

hello from switzerland !

 

steve


A gracefully way to logging SerialPort data?

  

I want to log SerialPort data gracefully. Here is the detail,

SerialPort.Write()
SerialPort.ReadExisting()
SerialPort.Read...()

To logging the input/output data, have I write a proxy class and replace all REAL SerialPort with the class? Then I can insert any logging code in the proxy class and forward Write(), Read(), and all other calls to the underlying SerialPort?

Oh, we can subclass the SerialPort.... However, we still have to create the proxy class and replace the real SerialPort with it EVERYWHERE. (Whenever the code needs SerialPort, we give it SerialPortWithLogging.)  I do not think this method is clean.

I also ‘superclass’ the SerialPort. By introducing a new interface and using only the interface to contact with SerialPort, I can ensure all I/O data are logged.  In the concrete implement, I forward the interface call to the SerialPort. I think it mess my code too.

I want to log the I/O data silently in background and withdraw the logging quietly whenever possible.

I think such I/O logging requirement is so common and it must have a more graceful way to accomplish it. (Inject? Attribue?...)

Any suggestion? Thank you very much!

 


EnterpriseLibrary.Data 5.0 for SYBASE

  

Hello guys,

I know we can use EnterpriseLibrary for SYBASE Database. This is my first time to use SYBASE. What I client, pluging or dll I need to run SYBSE with EnterpriseLibrary Data? In others words What I need and I how run EnterpriseLibrary data with SYBASE?

 

Thank You 


SSRS 2005 - Extra Data (Characters) after SQL result

  

Hi,

I ran into a snag with Reporting Services 2005. When I run a query in RS against SQL it returns me a result with some additional data (characters) + bunch of spaces!! So here is an example: my query returns a varchar, when I run it in SQL it is fine and returns me:

"SHRIMP 5 SAMPLE"

When I run it SSRS in the Data tab, I get "SHRIMP 5 SAMPLE E NET WT 5 SAMPLE                                                                                                                " (extra data and bunch of spaces)

It does it for all results. The extra characters are absolutelly unrelated to this record BTW so I have no clue where it's picking those up from!

Here is what I tried so far without any luck:

-I made sure the database is correct and I'm connecting to the correc

Invalid Model Data Base. Requires Version:3 but has Version: 0

  

Hi everyone…  I interpreted and installation manual wrongly.  So I assume that a needed to remove and re-install my SQL server 2005. The manual clearly mention that it will be a good Idea to back up my files. I follow the manual instructions and backed up all the files … 4 totals.

Re-install the SQL server 2005 and all working just find. After the installation I try to restore by backup files. Its looks like it does It and suddenly I got and error message. 

“unable to login user to database with the EXECUTE permission was denied on the object ‘p_CreateSeccion’, database ‘422-chaff’, schema ‘dbo’.”

Well this I have check the size of the mdf and ldf files and they are the same as my previous files ( notice that I have a complete copy of the folder where the SQL used to be install, So I have all the old files) but if I try to load the data file it show this error message.

“invalid model database. Requires Version: 3 but has Version:0”

I call the office from the guys how made the software I’m using and they will need to research it, they say is a version issue saying that my backup files have a newer version that my SQL server or something like this.

Does someone know how to fix this or upgrade, downgrad

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend