Tuesday, September 13, 2011

An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its

Today I was exploring Enterprise Library 4.1 and encounter this error. I created a sample application and added reference to few DLL from "EntLib41Src¥bin" folder to my application. When I hit F5 to run the application I got following error,
"An error occurred creating the configuration section handler for exceptionHandling: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0×80131040)"
      While searching for the reason I found a link here. According to this link assemblies in "EntLib41Src¥bin" folders are not strong name assemblies. So when you run the application you will encounter error as shown above. While "Program Files¥Microsoft Enterprise Library 4.1 – October 2008¥Bin" folder contains strong name assemblies. You have to add reference from "Program Files¥Microsoft Enterprise Library 4.1 – October 2008¥Bin" folder in your application.
Happy Debugging !!
#trivedimehulk@gmail.com

Thursday, September 1, 2011

Find column from T-SQL...

SELECT TABLE_NAME
ORDINAL_POSITION
,COLUMN_NAME
,DATA_TYPE
,CHARACTER_MAXIMUM_LENGTH
,IS_NULLABLE
,COLUMN_DEFAULT,*
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
COLUMN_NAME like '%patientrespons%'
ORDER BY
ORDINAL_POSITION ASC;
#trivedimehulk@gmail.com