enterprise-library

Enterprise library not logging severity correctly

时光毁灭记忆、已成空白 提交于 2019-12-01 11:24:31
问题 I have a problem with enterprise library 5. It's writing to the event log all the information I want it to write, however, it is not respecting the severity settings I configure. My exception handling configuration block looks like this: <exceptionHandlers> <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging...," logCategory="General" eventId="10000" severity="Critical" title="My unknown error" formatterType="Micros...ExceptionFormatter,

Enterprise Library Application Blocks OR Home Grown Framework?

放肆的年华 提交于 2019-12-01 11:06:52
We are currently looking to adopt some type of "standard" developer framework and have looked into using the Enterprise Library. Would you recommend using these blocks as the foundation for software development, or should we do something home grown ? Like all good answers to architecture and programming questions, the answer is "it depends". It depends on how unique your data access and object design needs are. It may also depend on how you plan on supporting your application in the long term. Finally, it greatly depends on the skill level of your developers. There isn't a one-size-fits-all

How can I insert more than 8000 characters in a VARCHAR(MAX) column with ExecuteNonQuery?

依然范特西╮ 提交于 2019-12-01 10:51:38
I am trying to insert > 8000 characters (submit from a web page) via ExecuteNonQuery (and DatabaseFactory.CreateDatabase() from MS Practices Enterprise Library). The stored procedure defines the parameter as VARCHAR(MAX) . The column is VARCHAR(MAX) . In theory, 2GB of data should be able to be passed. What can I do to pass data > 8000? I set a breakpoint and the string.Length is indeed > 8K. public static void UpdateTerms(string terms) { Database db = DatabaseFactory.CreateDatabase(); db.ExecuteNonQuery("uspUpdateTerms", terms); } Stored procedure: ALTER PROCEDURE [dbo].[uspUpdateTerms]

Return identity of last inserted row from stored procedure

微笑、不失礼 提交于 2019-12-01 08:27:30
I am trying to return identity of last inserted row from a stored procedure. A simplified version of my code looks like this: CREATE PROCEDURE [sp_name] @AuthorisationCode uniqueidentifier AS INSERT INTO [tablename] ([AuthorisationCode] ) VALUES (@AuthorisationCode ) RETURN @@IDENTITY GO I am calling this stored procedure via Execute Scalar in Enterprise library 4.1. It returns null. Anybody see what I am doing wrong. I'd say you should be using SCOPE_IDENTITY() as @@identity will return the identity of the last thing inserted (which may not be your stored procedure if multiple queries are

Return identity of last inserted row from stored procedure

China☆狼群 提交于 2019-12-01 04:48:18
问题 I am trying to return identity of last inserted row from a stored procedure. A simplified version of my code looks like this: CREATE PROCEDURE [sp_name] @AuthorisationCode uniqueidentifier AS INSERT INTO [tablename] ([AuthorisationCode] ) VALUES (@AuthorisationCode ) RETURN @@IDENTITY GO I am calling this stored procedure via Execute Scalar in Enterprise library 4.1. It returns null. Anybody see what I am doing wrong. 回答1: I'd say you should be using SCOPE_IDENTITY() as @@identity will return

Table valued parameter in a stored procedure gets execute permissions denied error

。_饼干妹妹 提交于 2019-12-01 02:15:34
I get the following error when calling a stored procedure that has a table valued parameter as one of the parameters The EXECUTE permission was denied on the object 'ValidationErrors' ValidationErrors is a TVP created with the following statement: CREATE TYPE [dbo].[ValidationErrors] AS TABLE( [ErrorMessage] [varchar](255) NOT NULL ) The user executing the stored procedure has execute privileges on the stored procedure. However, I still get the above error. Any ideas? I think you may also need to grant the user permissions to the type. References for GRANTing permissions to types: SQL 2005 SQL

Unity / EntLib: Injecting a dependency into a CustomTraceListener

故事扮演 提交于 2019-12-01 00:47:05
Sorry, this is quite a special topic so this may not be of interest to many. :-( However, I need to do the following thing: I have an application that provides logging to some kind of console window (it's a WPF window, because of application requirements and because the application needs to look flashy even here - our special customer asked for that and talks about it every time we meet) To provide thread - agnostic logging I created an interface / implementation pair "IGUIController" / "GUIController" So far, so good. It's all fine. However: I need my own custom trace listener (I call it

Upgrade to Enterprise Library 6.0 giving issues with 'EnterpriseLibraryContainer'

故事扮演 提交于 2019-11-30 22:59:37
After upgrading to Enterprise Library 6.0 I'm having the following problem: private static IUnityContainer container = EnterpriseLibraryContainer.Current.GetInstance(); Cannot resolve EnterpriseLibraryContainer I found another post that speaks about the EnterpriseLibraryCOntainer on stackoverflow In the upgrade notes of Enterprise Library it states: “The name ‘EnterpriseLibraryContainer’ does not exist in the current context The bootstrapping code for all of the blocks has changed in version 6 of Enterprise Library. The blocks no longer use Unity to manage the initialization and configuration,

Table valued parameter in a stored procedure gets execute permissions denied error

不羁的心 提交于 2019-11-30 21:40:09
问题 I get the following error when calling a stored procedure that has a table valued parameter as one of the parameters The EXECUTE permission was denied on the object 'ValidationErrors' ValidationErrors is a TVP created with the following statement: CREATE TYPE [dbo].[ValidationErrors] AS TABLE( [ErrorMessage] [varchar](255) NOT NULL ) The user executing the stored procedure has execute privileges on the stored procedure. However, I still get the above error. Any ideas? 回答1: I think you may

Why do I get System.IO.FileLoadException: Could not load file or assembly, about once a week on my ASP.Net Website?

只谈情不闲聊 提交于 2019-11-30 20:32:24
I have a rather simple internal ASP.Net Website that has issues loading the Microsoft.Practices.EnterpriseLibrary.Data dll about once a week. Here is the Exception message: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. File name: 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' at foobar.Intranet.Logic.Data.UserDB.SelectByUserName(String userName) at foobar.Intranet.Logic.Info.User