Copy Source As Html Add In
As a blogger that publishes code snippets from time to time, the thing I hate the most is to copy code to the post. I always have to edit all the line breaks and the identation in order to make the text look like code.
Recently I've came accross Copy source as HTML which allows you to copy source code, syntax highlighting, and line numbers as HTML. I played with it a little bit and found this add in very usefull!
using (MapConnection conn = new MapConnection(Settings.Default.AWv3MappingConnectionString))
{
conn.Open();
MapCommand cmd = conn.CreateCommand();
cmd.CommandText = @"
SELECT VALUE sp
FROM AdventureWorksModel.AdventureWorks.SalesPeople as sp
WHERE sp.HireDate < @Date";
cmd.Parameters.AddWithValue("Date", date);
DbDataReader r = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
while (r.Read())
{
Console.WriteLine(" {0:d}\t{1}",
r["HireDate"], r["FirstName"]);
}
Enjoy!