T-SQL tip: log error details in catch

0 Comments

If you want to log detailed information on an error in a catch block, you can use the following code:   BEGIN CATCH declare @Message varchar(2048) = '<< Your custom error text here. >>' +

How to convert a string to a stream, without using encoding in C#

0 Comments

If you want to convert a string to a stream, without using encoding. You can use the following string extension:   usage namespace PTB.Cs.Test.Research { using PTB.Cs.Extensions; using System; using System.IO; using Xunit; public class

Variable sized column with ellipsis in a table

0 Comments

If you want a column of a table in HTML to expand and you want the text to show "ellipsis" for overflowing text, you can use the solution found at:   http://stackoverflow.com/questions/17345158/variable-sized-column-with-ellipsis-in-a-table   Just give

How to get the absolute root folder path of a ASP .NET website / MVC website.

0 Comments

  The following code result in my case to rootFolderPath = "C:\inetpub\wwwroot\MvcApplication1". Uri uri = new System.Uri(Assembly.GetAssembly(typeof(MvcApplication)).CodeBase); string binFolderPath = Path.GetDirectoryName(uri.LocalPath); string rootFolderPath = new DirectoryInfo(binFolderPath).Parent.FullName;

Fontawesome is awesome!

0 Comments

  Fontawesome can be found at: http://fontawesome.io Icons based on a font, gives you infinite scale, icon color adjustment with CSS etc.:   <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Font awesome</title> <link href="css/font-awesome.css" rel="stylesheet" /> </head>