In C#, When to use String verses string

idesign1.jpg

So, technically, String and string mean exactly the same thing in C#.  string, is an alias for String (aka a shorthand) for System.String.  So, when should use which?  It seems that the convention is to use string when you are referring to an object and String when you are referring specifically to the string class. This is basically what is said at this URL:  http://en.csharp-online.net/CSharp_String_Theory%E2%80%94string_versus_String Juval Lowy has some coding standards at http://www.idesign.net that says basically the same thing.  From the document on IDesign's web site the following examples show what is best practices (which I completely agree with). … Continue Reading

My first LINQ Experience. How to do a simple COUNT() with LINQ to SQL

appcode.jpg

So, nothing extraordinary here, but I've finally taken the dive into LINQ.  I've got a great book that helping me a lot that I recently review called Pro LINQ by Joseph Rattz (his humor is a little odd, but the book is great).  At anyrate, moving right a long, all I did was right click on my web projects app_code directory, choose LINQ to SQL classes, Then, choose some tables from my database. Then, in my code, all I had to write was the class in my c# code (part of my database layer classes).  Here is what the code looks like (sorry about the jpg, I'm still trying to figure out how to get Copy SourceAsHTML working in vs2008) … Continue Reading

Pro ASP.NET 3.5 and C# 2008 Released! Another Master Piece

Many of you know that my favorite technical book in the world was Pro ASP.NET 2.0 and C# 2005 by Mathew MacDonald.  Well, Mathew has done it again.  I can't believe I didn't know it was coming, but there I was in the book store looking for books on LINQ and right in front of me was his new book with a nice chapter on LINQ.  So, it's now mine!  It's also got a large section on all the new Ajax stuff that I'm looking forward to reading.  I'm mostly a back end database kind of guy but I know I need to learn the javascript stuff better.  I can do it, but not as well as I'd like to be able to. Run don't walk.  go buy this book! Amazon.com: Pro ASP.NET 3.5 in C# 2008, Second Edition … Continue Reading

Book Review: Pro LINQ Language Integrated Query in C# 2008 by Joseph C. Rattz, Jr.

Now that Visual Studio 2008 has RTM' d, I'm very motivated to learn LINQ.  Like most of us, I've read articles, seen presentations, talked a lot about it, but now, it's time to begin in earnest.  What does that mean?  Time to get the books and start doing some serious examples myself.  I just bought the book "Pro LINQ Language Integrated Query in C# 2008" and so far am very impressed.  Because I'm a total newbie to link, I started with the first chapter (very unusual for me).  That was a good overview of the different types of LINQ.  One thing I learned was that all those names like dlinq,xlinq, etc. are no longer valid.  I kind of thought that, but couldn't find it written explicitly … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: