BlogEngine.net: 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='http://twitter.com/share' class='twitter-share-button' data-url='<%=Post.PermaLink %>'
<iframe src='http://www.facebook.com/plugins/like.php?href=<%=Post.PermaLink %>&layout=button_count&show_faces=false&action=Like&colorscheme=light'
frameborder="0" scrolling="no" style="border-style: none; height: 20px; width: 90px;
- 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="http://www.dotnetkicks.com/kick/?url=<%=Post.PermaLink %>&title=<%=Post.Title %>"
<img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=<%=Post.PermaLink %>"
border="0" alt="kick it on DotNetKicks.com" /></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.
DBCC OPENTRAN WITH TABLERESULTS, NO_INFOMSGS
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.
DBCC INPUTBUFFER (64)
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.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.