enterprise-library

How do you refill a byte array using SqlDataReader?

北战南征 提交于 2019-12-23 06:24:09
问题 This is in reference to: byte[] and efficiently passing by reference And the SqlDataReader found in this post: Getting binary data using SqlDataReader Inside a loop, I'm calling a database and returning a large object ( varbinary[max] ). Currently, I'm running into OutOfMemory exceptions, so I'm trying to reduce the footprint in the Large Object Heap (LOH). So, I'm creating a byte array for the largest file that I'd download and adding some padding just in case. For instance: byte[]

How do you refill a byte array using SqlDataReader?

谁都会走 提交于 2019-12-23 06:24:05
问题 This is in reference to: byte[] and efficiently passing by reference And the SqlDataReader found in this post: Getting binary data using SqlDataReader Inside a loop, I'm calling a database and returning a large object ( varbinary[max] ). Currently, I'm running into OutOfMemory exceptions, so I'm trying to reduce the footprint in the Large Object Heap (LOH). So, I'm creating a byte array for the largest file that I'd download and adding some padding just in case. For instance: byte[]

ESB Toolkit and Enterprise Library collision

蹲街弑〆低调 提交于 2019-12-23 05:50:53
问题 Hi i need to use enterprise library 5 to maintain consistency across the board in the enterprise environment. Unfortunately we have got biz talk installed in our machines. It seems that enterprise library collides with ESB Toolkit. ESB Toolkit creates a section in machine.config for enterprise library which is version 4.1. Every time i run my application it reads the config from machine.config and the application catches the exception. To solve this i included <section name="enterpriseLibrary

Microsoft Application block DLL V2 and V4.1 references

此生再无相见时 提交于 2019-12-23 05:39:16
问题 My application is referencing Microsoft Enterprise library V4.1 while one of the older DLL (external application) requires a reference to Microsoft Enterprise library V2.0. I know for sure that i can register both of these assemblies in the GAC and the application will start reading relevant DLL as required but that is not a solution for us since our security expert is not agreeing upon accepting this solution. Is there any way using the webconfig where I can specifically specify that the

EnterpriseLibrary Data Access Application Block redirect Section can't find default database

﹥>﹥吖頭↗ 提交于 2019-12-23 02:44:08
问题 How can I to get working the Data redirected section for EnterpriseLibrary Data Access Application Block? I would do like to have the definitions for databases removed from app.config and placed on a standalone database.config file. I try to do the same way I am doing with the logging.config and and exception.config files but I can't get it work. using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; using Microsoft.Practices.EnterpriseLibrary.Data; using Microsoft.Practices

Asp.Net MVC 2 Client validation implementation for Enterprise Library Validation Block

拜拜、爱过 提交于 2019-12-22 17:46:07
问题 I've found a very good article about how to use EntLib Validation Block for server validation in MVC 2. But as there pointed out The current design of EntLib’s Validation Application Block uses the Composite pattern; that is, when we ask for validation for an object, it returns back a single validator object that contains a list of all the validation work to be done. While this is very convenient from a normal usage scenario, the unfortunate side-effect is that we can’t “peek inside” to see

entlib Invalid TraceListenerData type

孤人 提交于 2019-12-22 10:59:06
问题 I've created a custom listener for Enterprise Library 5 Logging Block, which is recognized by the Configuration Editor, but throws a run-time configuration exception: Attempt to Use the Custom Logger static IUnityContainer _container; static LogWriter _writer; static IServiceLocator _locator; public static void Inf(string message) { if (_container == null) { // Create the container _container = new UnityContainer(); // Configurator will read Enterprise Library configuration // and set up the

How to register multiple types that implement the same interface

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 10:49:28
问题 I have a single interface and this is being used by 2 classes. I am using unity configuration to identify the instance based on the interface. Now I want to know how should i register these types so that i can call the appropriate implementation based on the single interface itself. 回答1: This is how I do it: var container = new UnityContainer().RegisterType<IAmImplementedMoreThanOnce, Implementation1>("Implementation1") .RegisterType<IAmImplementedMoreThanOnce, Implementation2>(

DAAB, the best approach to use Database instances is

坚强是说给别人听的谎言 提交于 2019-12-22 08:25:32
问题 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 something like public property which returns the instanced database. How it is “heavy” or fast/slow to create an instance of Database class? What if I do it

Retrying C# HttpClient Unsuccessful Requests and Timeouts

大兔子大兔子 提交于 2019-12-21 21:10:02
问题 I'm trying to build in retrying in an HttpClient DelegatingHandler such that responses such as 503 Server Unavailable and timeouts are treated as transient failures and retried automatically. I was starting from the code at http://blog.devscrum.net/2014/05/building-a-transient-retry-handler-for-the-net-httpclient/ which works for the 403 Server Unavailable case, but does not treat timeouts as transient failures. Still, I like the general idea of using the Microsoft Transient Fault Handling