Mladen Prajdić Blog

Blog about stuff and things and stuff. Mostly about SQL server and .Net

C# 2.0: Arity - ever heard of it?

Arity is the number of arguments that a method takes. For example void MyMethod(int i1, int i2)  has an arity of 2, since it takes 2 arguments. In C# the arity is marked with ` Read more →

Weird C# compile possibility

Now this is something i really didn't think it would compile in C#.  private int _someVar = 0; private void DoStuff1() { int _someVar = 0; _someVar = 6; // . Read more →

How to Override Non-Virtual Base Members in C#

This is something i assumed was common knowledge, but apparently it isn't. If you want to have a method in your derived class with the same name as the one in the base class and the base class one isn't marked as virtual you can use the NEW keyword. Read more →

Multiple Active Result Sets

I've written an article about Multiple Active Result Sets (MARS) and it's published on SQLTeam.com Multiple Active Result Sets is a new SQL Server 2005 feature that, putting it simply, allows the user to run more than one SQL batch on an open connection at the same time. Read more →

How do you write your Flagged Enums?

A while ago i explained why do you need a [Flags] attribute on the Enum here. We'll since then i was happy with my flags until i got to the point of having 16 flags. Read more →

When (int)x isn't the same as Convert.ToInt32(x)

Having started programming in c/c++ i've always been used to casting between types using () operator: int i = (int)x With the coming of .Net framework ValueTypes and ReferenceTypes were introduced and we started hearing about boxing and unboxing. Read more →

VS 2k5 autogenerated code gem

A coworker found this in code generated by Visual Studio 2005: this.sqlSelectCommand2.CommandText = "SELECT columnName1, columnName2, columnName3, columnN" + "ame4, columnName5, columnName6 FROM MyViewFromMa" + "nyTables" Searching for MyViewFromManyTables is beautifull. Read more →