SQL script to view sizes of all tables
SELECT t.NAME AS TableName, p.rows AS RowCounts, SUM(a.total_pages) * 8 AS TotalSpaceKB, SUM(a.used_pages) * 8 AS UsedSpaceKB, (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB FROM...
View ArticleOverride EF 5 database mapping
public class UserRepo { private UserContext _context; public UserRepo(UserContext context) { _context = context; } public User Save(User user) { if (user.Id <= 0) { _context.Users.Add(user); }...
View ArticleSelectListItem Helper to create selectlistitems from enum
first, we create a extension method to get the descriptions of enum values. public static string ToDescription<T>(this T enumValue) where T : struct, IConvertible, IComparable,...
View ArticleC# 6 null check
Like nullable types, null-conditional operators can be used now. Just put a ‘?’ (question mark) after the instance before calling the property on top of it. You don’t have to write additional if...
View ArticleRecovering deleted files from an svn repository
To recover a file from svn that you deleted from your local repository, it’s first necessary to get the proper name of the file, and the revision of the repository it last existed in. To do that...
View ArticleVagrant
Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the...
View ArticleCassandra tips
Use short column names Column names take space in each cell, and if you use a big clustering key, it will be copied all over your clustered cells. Eventually, we have found in some situations that...
View ArticleSQLCMD to export sql data
export to a csv sqlcmd -S . -d DatabaseName -E -s',' -W -Q "SELECT * FROM TableName" > C:\Test.csv
View ArticleSetup a private nuget server
Deploy nuget server project Nuget Server package on nuget.org: https://www.nuget.org/packages/NuGet.Server/2.11.3/ The project source: https://github.com/NuGet/NuGet.Server deploy the project to IIS,...
View Articlegit merge vs rebase
Rebasing and merging are both designed to integrate changes from one branch into another branch but in different ways. If you have a feature branch, REBASE: you want to rebase the feature branch onto...
View Article
More Pages to Explore .....