I haven't been using this function at all. Who knows why... maybe because i didn't know about it :)
But in my latest pet project i had to do something really quickly on a lot of items in a list.
Read more →
A negative Width value?? I can hear it now:
Are you insane Mladen?? Do you want our apps going around looking ugly??
Well... of course I do! It means i can go around fixing them for big bucks :))
Read more →
Tests are a pretty much a must in today's world of programming. There's even a whole Test Driven Development methodology that deals with this.
There comes a time when we have to test how our app interacts with the database.
Read more →
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 →
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 →
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 →
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 →
I have written before about running Windows Forms GUI tests on a compiled application exe here.
And i must say that it works GREAT!
I had a few problems of which the most annoying was the Drag and Drop functionality.
Read more →
I just hate having nulls in my DateTime columns. Having them always mean you also have to handle them in some way in your app.
The most common way is something like this:
Read more →
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 →
NUnitForms is a pretty awsome tool for GUI unit testing.
However it lacks one major thing. You can't test a whole exe or dll.
For example if you have a MyTestApp.
Read more →
Ever missed a Prod(columnName) function that works like a sum but it multiplies the column values?
If you have then you probably know that there's a workaround using a bit of high school math knowledge about base 10 logarithms.
Read more →
If you're reading this blog you're probably familiar with ADO.Net and it's SqlCommand object.
Now this SqlCommand object has a CommandTimeout property that specifies the number of seconds after which the command will terminate.
Read more →
Enums are a great tool. They give meaning to meaningless numbers.
I love using them as flags since it couldn't be simpler. So i always used the [Flags] attribute on my enums
Read more →
A SELECT tag is what a DropDowList in Asp.Net renders to in HTML and it's a standard web control.
If you ever had to pop up a DIV over it (a menu in most cases) then you know that in IE6 and below and FireFox 1.
Read more →
I was playing with some historical data (family tree) and i wanted to store data in sql server. When looking into family trees you reach the minimum datetime value of 1753-01-01 very soon.
Read more →
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 →
In a previous post I've shown how to use High precision timer.
That method had a drawback of working for whole server not distiguishing between connections.
So if you ran the time measurement in 2 different windows in SSMS the times would be incorrect.
Read more →
Update: I've created a muliti connection version which can be found here.
Usually time measuring in sql server is done in 2 ways: with the help of GetDate() function or with SET STATISTICS TIME ON.
Read more →
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 →