Skip to main content

Posts

IIS Application browsing error " Oracle.DataAccess Incorrect Format"

Error : Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format. Solution : In the IIS Manager select your server and select " Application Pools ". Select the application pool used by your Web App and click on " Advanced Settings " from the right hand menu. In the " General Section " of the advanced Settings click on the " Enable 32-bit Applications " and set it to True . This fix only applies to 64-bit servers that attempt to execute the 32-bit version of the Oracle Dlls.

BizTalk : Validate incoming XML Request Messages with Schema in Pipeline

Validate incoming XML Request Messages with Schema in Pipeline  To validate your input XML message with Schema defined in BizTalk project, Please follow the following simple points. Make the following change in your XML pipeline properties, Need to set following highlighted properties in your BizTalk Admin console Change it to following values: ValidateDocument : True; DocumentSpecNames :   BizTalk_Server_Project1.Schema1, BizTalk Server Project1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b64a0508dbe93103 You will get this value from Schema Propery , it will be   [ Name, Assembly] After this your input schema will be validated with specified schema.

IIS7 /ASP.NET : Image does not display after deploying on IIS

IIS 7 ASP.NET, after deploying my web application on IIS image were not displaying When I work with Visual studio default server everything works and displayed as required but when I deployed the application on IIS my images were not displaying. I tried putting all different URL for my image, Like ImageUrl ="/Image/cal.png" ImageUrl ="../Image/cal.png" ImageUrl ="~/Image/cal.png"   But it didn’t helped me and then I thought there might be something IIS setting missing for this. And when I verified the IIS installation setting, the “STATIC CONTENT” option of IIS was unchecked and hence it was not displaying the image. After clicking the checkbox "True" everything worked as per expectation.

C#.NET to read Registry value from machnie

Get Registry value from Machine You can use following method read registry value from mahcine, it will return registry value based on input parameter. C# Method public string getRegistryValue( string subKeyPath, string KeyName) { // Create value variable string regValue = null ; try { // Opening the registry key RegistryKey regLocalKey = Registry .LocalMachine; // Open a subKey as read-only RegistryKey regKey = regLocalKey.OpenSubKey(subKeyPath, RegistryKeyPermissionCheck .ReadSubTree, System.Security.AccessControl. RegistryRights .FullControl); // If the RegistrySubKey does exist if (regKey != null ) { // If the RegistryKey exists get its value or null is returned. regValue = ( string )regKey.GetValue(KeyName.ToUpper()); }   } catch ( Exception ex) { regValue =null ; } return regValue ; } Test the above method : string regValue = getRegistryValue( @"Software\Microsoft\Internet Explorer" , "W2kVersion" );

SQL : Inserting multiple rows using onq sql query

Following SQL query is used to insert multiple record into table INSERT INTO tmpTable (field1, field2,field3) VALUES  ('74251', 'Black', '511black') INSERT INTO tmpTable  (field1, field2,field3) VALUES  ('74251', 'CharcoalF', '5145') INSERT INTO tmpTable  (field1, field2,field3) VALUES  ('74251', 'KhakiQ', '5165') INSERT INTO tmpTable  (field1, field2,field3) VALUES  ('74251', 'NavyA', '515') INSERT INTO tmpTable  (field1, field2,field3) VALUES  ('74251', 'OD', '511')

Converting Stream to String and String to Bytes

C# : Converting Stream to String and  String to Bytes Following code can be sued for converting stream to string and then stream to bytes. Stream Stream1 = bodyPart.GetOriginalDataStream();                              String test = new StreamReader(Stream1).ReadToEnd();                             System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();                             Byte[] bytes = encoding.GetBytes(test);

Convert BizTalk MessageBodyPart to String

Get MessageBodyPart as string in Custom Pipeline component execute method. In the follwoing code pInMsg.BodyPart is converted to String using stream. You can edit this messsage steam as per your requirement then assign to new message traceDataRequest.Message. Following code can be used for tracing the request message recived by BizTalk pipeline or to modifiy the request received. We have used eventlog entry to log the message for tracing.                            int bufferSize = 0x280; //  TODO move to external config                             int thresholdSize = 0x100000;   //  TODO move to external config              ...