Schema TypeName Types and RootNode TypeName – collides

I was getting this error first “namespace attribute of an import must not match the real value”. I had a group schema, that had a repeating record of a second schema. That second schema did not have any Target Namespace, to match what a trading partner had given us. This StackOverflow article reminded me that […]

Getting “Root element is missing” in a BizTalk Orchestration

I had this case again today, where I got “Root element is missing”. The code was working, I made some changes, and boom, an existing code path started blowing up. It was actually a trace routine, where I had the following code: <pre>    xmlDoc = msgWhatever;    //then I passed as a parameter:     […]

Get the SQL Server Name of BizTalk in C#

Sometimes, you might need to get the SQL Server Name of the SQL Server where the BizTalkMgmtDB The C# code below, uses the registry to get that server name, and also builds a connection screen to some database on that server (where you pass the Database Name as a parameter). MgmtDBServer (in the rk.GetValue below), […]

Speeding up Getting all Files in Directory after a Certain Date

There was a typo below, the first time is using LINQ, the second one is using Directory.GetFiles (then getting the time on each file within a loop). Big Difference, right? The last one is 41 times slower. The difference was not really using LINQ, but using the DirectoryInfo.GetFiles instead of the combination of Directory.GetFiles and […]

C# DateTime and Oracle DateTime ORA-01843

I got this error: ORA-01843 Oracle date format picture ends before converting entire input string The variable fileDateTime was a defined as a normal C# DateTime. Code Failed with ORA=01843                     commSQL.CommandText = "UPDATE MY_TAB " +                         " SET DATE_FILE_PROCESSED = TO_DATE('" + fileDateTime + "', 'MM/DD/YYYY HH:MI:SS')" +                           " WHERE DATE_FILE_PROCESSED IS NULL AND CUST_PO_NO […]

Traverse XML Elements/Values with XmlDocument in C#

I’m in the process of writing a C# program that will validate field sizes (and maybe data types) against a SQL table. I need to traverse through each element and get the element value, the next step will be to validate it each element value. The code below will “walk the tree” structure of the […]

Mass Delete of Old Rows in T-SQL

I have a SQL/Trace, and it’s a requirement to each night delete all rows in the Trace over x days old. This is typically called a purge program, or mass delete. If you don’t limit the data, then you can knock the lights out of SQL. Below is a modification to code I found here: […]

VBScript Function to Count Rows in a CSV File

I was working with an old third party tool that only supported VBScript for programming.  I needed to email a file if the file had more than one row.  All the CSV (Comma Separated Value) files created had the CSV headers on the first line. Basically, this was an error/exception report, so I only wanted […]

VBScript Date Formatting For Filenames

Below is just a code fragment that creates a date useful for putting on a filename. It’s not particular elegant, and there are other ways to do the same thing (for example using the PAD function). But it works and it’s easy to read and change. dtYear  = year(date) dtMonth = Right(String(2,"0") &amp; Month(date), 2) dtDay   […]

VBScript Function to Delete Files in Directory matching name over x days old

Yes, it’s the year 2015, and I still find myself creating VBScripts from time to time. My client has an old server that uses a third party tool to do database extracts, and it supports only VBScript. So we have scripts that email CSV (Comma Separated Value) extracts, and/or copy them to various folders on […]