Archives for June 2007
Coding against the DB
If you have to embed SQL in your code, this is how to do it in C#.
Highlights:
the using statement, which is like try-finally
@-quoted string literals
Parameters.AddWithValue(parameterName, value) (new in .NET Framework 2.0)
Coming from an ASP/PHP-MySQL background, it’s great to not have to escape special SQL characters or to enclose varchar values within single quotes.
using System.Data;
using System.Data.SqlClient;
using […]
Polymorphism Explained
Polymorphism is the ability of an object to represent more than one type.
The MSDN Library explains polymorphism quite well. Emphasis mine.
PLAIN TEXT
C#:
public class A
{
// code
}
public class B : A
{
// code
}
"In the example above, class B is effectively both B and A. When you access a B object, you can use [...]
Comparative Overview of C#
I came across a clear and balanced overview of C# that pits it against C++ and Java. Do note that it was written just after Microsoft released .NET Framework 1.0, so it doesn't cover generics and anonymous methods. It's still good, though, as almost every point is illuminated by concise yet intuitive example code.
Hello C# World
I have decided to specialize in C#, believing that it will bring me higher pay and a better career path. My background is a mishmash of VB6, ASP, PHP, and .NET (both VB and C#). Due to certain circumstances, I didn't manage to get on the Java boat.
My perception of employers' perception is that ASP [...]
