enterprise-library

DAAB GetParameterValue does not return output parameter value

两盒软妹~` 提交于 2019-12-13 06:34:37
问题 I have a stored procedure that recives as paramter as OUTPUT paramter. The store procedure sets its value. I have the following code in C# application. But I am not getting the value in application (the output is returned as zero). What is the missing link here? CREATEPROCEDURE [dbo].aspInsertZipCode ( @CountOfUnchangedZipCode AS INT=0 OUTPUT ) AS BEGIN SET NOCOUNT ON SET @CountOfUnchangedZipCode = 13 END In the application, code is as follows DbCommand cmd = db.GetStoredProcCommand(

Enterprise Library - Get value from ParameterValue Expression

喜夏-厌秋 提交于 2019-12-13 05:03:32
问题 I am trying to convert Enterprise Library TypeRegistration ConstructorParameters to a collection of key/value pair (a HashTable or an IDictionary in general). The ConstructorParameters property is an IEnumerableOf(ParameterValue) so my problem is how to extract the values from each ParameterValue object. Every ParameterValue object contains a Type and an Expression. For ex. if a ParameterValue contains: "EventLoggingEnabled = false" then I can get the key (which is the EventLoggingEnabled)

IBM DB2 Core: Connection string for ASP.NET Core 2.1 and Microsoft Enterprise Libraries

守給你的承諾、 提交于 2019-12-13 03:21:02
问题 I'm using this Microsoft.EnterpriseLibrary port for .Net Core. It requires a configuration file app.config with the connection string specified in it. I tried using the same connection string I use in another working project, but it doesn't work here. How can I specify a DB2 connection string for ASP.NET Core 2.1? I this is what I have tried: <connectionStrings> <add name="Development" connectionString="server=MY.SERVER.COM:446;database=DBXX;user id=USERXX;password=PASSWORDXX;" providerName=

Enterprise Library 5.0 - Adding custom tokens to a TextFormatter

依然范特西╮ 提交于 2019-12-12 18:23:20
问题 I have created a custom Exception that has data pertaining to our application. I want to ensure this data gets logged when an exception is thrown and logged to the event log. I have tried creating a custom TextFormatter which is being called but am not sure how to access the current exception so I can add our custom information to the log entry. There is something I am not understanding and would appreciate any help around adding custom tokens (and data) to Enterprise Library 5.0

The number of parameters does not match number of values for stored procedure

北慕城南 提交于 2019-12-12 12:28:55
问题 I am using Enterprise Library 5x DAAB to call an Oracle stored procedure with one input parameter and one output parameter. But it gives this error: The number of parameters does not match number of values for stored procedure My code is below: OracleDatabase _database; OracleConnection _connection; ... ... DbCommand insertCommand = _database.GetStoredProcCommand("spName"); insertCommand.Connection = _connection; _database.AddInParameter(insertCommand, "inParam", DbType.Int16); _database

Should I make Enterprise Library Data Block Database object static?

三世轮回 提交于 2019-12-12 10:09:46
问题 Can anyone clarify if Enterprise Library's Database object can be made static without any thread-safety issues? 回答1: Yes, an Database instance is thread-safe. It is just a big factory spitting out new objects like connections. The instance itself doesn't change state after it is created. When you look at the source code you can see this clearly. The objects it produces are of course not thread-safe. 回答2: You can, but there's no significant reason to. Database instances are cheap to create and

How do I 'globally' catch exceptions thrown in object instances

萝らか妹 提交于 2019-12-12 09:04:50
问题 I am currently writing a winforms application (C#). I am making use of the Enterprise Library Exception Handling Block, following a fairly standard approach from what I can see. IE : In the Main method of Program.cs I have wired up event handler to Application.ThreadException event etc. This approach works well and handles the applications exceptional circumstances. In one of my business objects I throw various exceptions in the Set accessor of one of the objects properties set { if (value >

,Activation error occured while trying to get instance of type Database, key “core_erp”

落爺英雄遲暮 提交于 2019-12-12 04:43:05
问题 Am trying to connect to a db (actually am put on an already built project :) ) . The code was connecting ok but after a windows issue and restroring, the following error shows up each time a DB connection is attempted. Activation error occured while trying to get instance of type Database, key "core_erp" .. have installed mysql .net connector but the error still shows up. As said that the project is already built but when the code was ported to this computer, the issue started to show up

Enterprise Library 6.0 Configuration Console with Visual Studio 2015 does not contain Autoscaling Settings

℡╲_俬逩灬. 提交于 2019-12-12 04:15:49
问题 1) I downloaded the lastest .VSIX file that brings Enterprise Library Configuration Console 6.0 into Visual Studio 2015 (https://randylevy.wordpress.com/2015/07/24/enterpriselibrary-config-for-vs2015/) 2) In my Azure project, I downloaded nuget package - EnterpriseLibrary.Config.v6 3) I also downloaded the Autoscaler Enterprise Block (WASABi) 4) I also downloaded Microsoft Enterprise Library 5.0 Integration Pack for Azure In my Azure project, when I right-click on the app.config file, I get

Wrong content RollingFile Log

夙愿已清 提交于 2019-12-12 03:48:07
问题 I'm using RollingFile log from Enterprise Library and I'm configuring it by this way: var builder = new ConfigurationSourceBuilder(); builder.ConfigureLogging() .LogToCategoryNamed("General") .WithOptions.SetAsDefaultCategory() .SendTo.RollingFile("Log File") .RollEvery(Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollInterval.Day) .UseTimeStampPattern("yyyyMMdd") .WhenRollFileExists(Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollFileExistsBehavior.Overwrite)