After reading @DaedTech’s very persuasive arguments for static code analysis I have decided to give NDepend a go. Download and install is slightly fiddly, you get a zip file with a number of files. Once you have found the instructions on the web site it takes just a couple of minutes to get set up. I analysed my current project… Read more →
Category: code
Generate POCO’s from Sql Server
DECLARE tableCursor CURSOR LOCAL FOR SELECT name, ‘Foundation’, name + ‘Dto’ FROM sys.tables WHERE 1 = 1 OPEN tableCursor DECLARE @tableName NVARCHAR(MAX), @schemaName NVARCHAR(MAX), @className NVARCHAR(MAX) FETCH NEXT FROM tableCursor INTO @tableName, @schemaName, @className WHILE @@FETCH_STATUS = 0 BEGIN DECLARE tableColumns CURSOR LOCAL FOR SELECT cols.name, cols.system_type_id, cols.is_nullable FROM sys.columns cols JOIN sys.tables tbl ON cols.object_id = tbl.object_id WHERE tbl.name… Read more →
How to test a database connection
Create a blank text file called something along the lines of TestConnection.udl Double click the file Test! Read more →
Property Copy – http://stackoverflow.com/a/2624847/1515209
using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; namespace MiscUtil.Reflection { /// <summary> /// Generic class which copies to its target type from a source /// type specified in the Copy method. The types are specified /// separately to take advantage of type inference on generic /// method arguments. /// </summary> public static class PropertyCopy<TTarget> where TTarget : class, new()… Read more →
Find Domain Group Members
Win+R Rundll32 dsquery.dll OpenQueryWindow or dsquery group domainroot -name groupname | dsget group -members | dsget user -fn -ln Read more →
Commands and Queries are Holistic Abstractions
This post has been updated Click here In this post I will outline an updated perspective on Commands and Queries. If you are unfamiliar with these two patterns then please see these posts here and here for a great introduction. For the remainder of this post I will assume you have fully subscribed to the idea of parameter objects and… Read more →
Method Injection with Simple Injector
In this post I will outline a trick I created while experimenting with the code for my post Managing Commands and Queries. If you are unfamiliar with these two patterns then please see these posts here and here for a great introduction. For the remainder of this post I will assume you have fully subscribed to the idea of parameter… Read more →
Managing Command and Query Parameter Objects
In this post I will outline some of the techniques I employ to manage my Commands and Queries. If you are unfamiliar with these two patterns then please see these posts here and here for a great introduction. For the remainder of this post I will assume you have fully subscribed to the idea of parameter objects and are comfortable… Read more →
Displaying CLOB data in Sql Developer 2
set serveroutput on format wrapped; declare my_var long; begin for x in ( select <col> from <table> where … ) loop my_var := dbms_lob.substr( x.<col>, 32000, 1 ); DBMS_OUTPUT.put_line(my_var); end loop; end; / Read more →
SourceSafe lost password
Open um.dat with a hex editor change to the following (ensure that exists 41 64 6d 69 6e) 0000080 55 55 bc 7f 41 64 6d 69 6e 00 00 00 00 00 00 00 0000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000A0 00 00 00 00 90 6e 00… Read more →