uliasz.com

Just another WordPress site

Recent Posts

Recent Comments

Archives

Categories

Meta

Automatic generation of EF entities and mappings from existing database schema

This is  a bunch of useful scripts for generating C# Entity Framework Code First POCOs from existing database schema. First, let’s create T-SQL function for generating C# class for EF entity: This function deliberately ignores certain…

Git aliases I can’t live without

Being still quite new to git (and moving from world of VSS/TFS), I became big fan of Git’s flexibility and configuration. It really boosts productivity and makes developer’s life much easier. Below I list git aliases I…

Unit Testing stack for C#/Visual Studio

After spending some time on digging through unit testing components, I ran into a setup I am finally happy with. This consists of: https://github.com/AutoFixture – acts as DI container/object factory, significantly improving unit test maintainability https://github.com/moq – awesome…

T-SQL Tricks

Few useful SQL tricks: Move table to different schema ALTER SCHEMA targetSchema TRANSFER sourceSchema.tableName Rename object sp_rename ‘schemaName.tableName.columnName’, ‘newColumnName’

Simplest way to restore MSSQL Server database

Here’s a simplest way I found (so far) to restore a database in MS SQL Server. First part lists “logicalnames” from the backup that you want to restore. Modify the path so it points to…

How to delete all stored procedures from MSSQL database using cursor

Here is a code for deleting all stored procedures in SQL Server database using cursor. DECLARE @name varchar(500) DECLARE @sql varchar(max) SET @sql = ” DECLARE cur CURSOR FOR SELECT [name] FROM sys.procedures OPEN cur…

How to close all connections to a MSSQL database

This script closes all connections to MS SQL database USE master; GO ALTER DATABASE dbName SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO ALTER DATABASE dbName SET MULTI_USER; GO

Animated iPhone-style ImageButton with Silverlight 4

In this article I am presenting a way to create animated iPhone-style ImageButton control in Silverlight 4. Button will have icon on it, rounded corners and will zoom-in/zoom-out on hover. It will be done programmatically,…

Using Sets in .Net

Great post by James Michael Hare I came across about using Sets in .Net. Definitely worth taking a look. http://geekswithblogs.net/BlackRabbitCoder/archive/2011/02/03/c.net-little-wonders-the-useful-but-overlooked-sets.aspx

WCF Custom tool error: Failed to generate code for the service reference.

Very recently, building multi-tier application involving Silverlight front-end inter-operating with WCF back-end, I encountered very odd, yet annoying behaviour of Visual Studio 2010. I was building new functionality using Telerik RadMap for Silverlight control that…

Categories

Tags

.NET Ajax ASP.NET ASP.NET MVC C# CTE Entity Framework git JavaScript jQuery SQL SQL Server T-SQL Unit Testing WCF Web Services XAML XML