Find the processes locking a .dll

 

A lot of times working with multiple developers on one box you run into a situation where a process is locking your dll.  The following command line might help. 

tasklist /m <dllname>.dll

Execute SQL Query from within a C# function

I don't know how many times I've had to execute a stored procedure or a SQL statement from within a BizTalk map or within a C# class, so I'm putting this entry as a reminder to myself of how to do it.

// 1. Create your SQL Connection SqlConnection conn = null; // 2. Create and open a connection object conn = new SqlConnection("Connection String Goes Here"); // 3. Open the Connection conn.Open(); // 4. Create the SQL Command and assign it it a string string strSQLCommand = "SELECT * FROM TABLE"; // 5. Execute the SQL Command SqlCommand command = new SqlCommand(strSQLCommand, conn); // 6. Use ExecuteScalar() to return the first result string returnvalue = (string)command.ExecuteScalar(); // 7. Close the Connection conn.Close(); // 8. Return the Value return returnvalue;

Get the Original File Name from either the HIPAA or BaseEDI adapters

One of the properties you'll quickly wish you had using either the BizTalk HIPAA or BaseEDI adapters is the original file name of the message with which you are dealing.  We've all searched for BTS.ReceiveFileName to no avail. 

Here I'm showing you that there is no BTS.ReceiveFileName:

image

We'll I've decided to build a C# class with two functions that will extract that for you easily.

The class I created has two static overloaded functions 1: GetBaseEDIOriginalFileNameFunction, and  2: GetHIPAAOriginalFileNameFunction. 

Simply pass the <yourmessage(BTS.MessageID)> and (optionally) the Server where your HIPAA or BaseEDI databases are located into the function and you'll have your original filename.

 

Email me if you'd like a copy