Twitter, FaceBook and DotNetKicks Buttons

Outside of setting up an extension you can easily add Twitter, FaceBook and DotNetKicks buttons to you BlogEngine.Net posts by inserting the following code snippets in the desired location of your theme’s PostView.ascx page:


<a href='' class='twitter-share-button' data-url='<%=Post.PermaLink %>'
                data-count='horizontal'>Tweet</a><script type='text/javascript' src=''></script>



<iframe src='<%=Post.PermaLink %>&layout=button_count&show_faces=false&action=Like&colorscheme=light'
                frameborder="0" scrolling="no" style="border-style: none; height: 20px; width: 90px;
                overflow: hidden;"></iframe>


  • The options for layout are button_count, standard and box_count 
  • The options for action are like and recommend 
  • The options for colorscheme are light and dark



<a href="<%=Post.PermaLink %>&title=<%=Post.Title %>"
                <img src="<%=Post.PermaLink %>"
                    border="0" alt="kick it on" /></a>


SQL: Long Running Transaction

For various reasons a SQL transaction can take an amount of time to complete.   OPENTRAN is the Databas Console Command (DBCC) that can be used to display information about the oldest active transaction. The TABLERESULTS argument will display the results in a table format.



The information in the table may be limited, however, once you identify the process ID (SPID) you can see the last statement sent from a client to the server with the INPUTBUFFER command.



SSIS: Programmatically set Flat File Destination filename

Recently, I was asked to export a subset of records to uniquely named delimited files. A task easily accomplished with SSIS by using a DataFlow Task and a Flat File Destination.  In this case, however, I was required to export record groups based upon a shared sequence id.  I was required to create a separate delimited file with a distinct name for each group.  Within a Foreach Loop, which was used to loop through a set of sequence id to apply as a filter against the recordset, I added a Script Task to build the file name and set it to a string variable:


public void Main()
			// this should be wrapped to catch errors
            Dts.Variables["strFilename"].Value = 
                + ".txt";

            Dts.TaskResult = (int)ScriptResults.Success;

In the DataFlow Task I added a Flat File Destination and went through the steps of the wizard to add a [delimited] text file connection.  I entered a generic name in for the filename.  Once completed, the text file connection appeared in the Connection Manager Window.  Select the text file connection, do not double click, which was created and look at the ConnectionString property in the Porperty Window.  This is where the filename is stored.  To change the filename programmatically you will need to create an expression for the text file connection.  Click the ellipse next to the Expression property and choose ConnectionString as the property and enter the variable name, which was set in the Script Task, as the expression.