Samples for C# Whidbey

Shaykat from the C# team sent me an email earlier today about what C# samples we should
include for Whidbey.  I thought it would be a good idea to ask the blogosphere
what samples you would like to see for C# Whidbey.  This can range from fully
functioning applications, to code snippets, to walkthroughs/tutorials.  We've
been reviewing the .NET Framework
, the 101
C# samples
, and the C#
How-To articles
and MSDN help for ideas, but it's difficult to measure whether
these are really effective examples. A lot of the topics will be beginner focused,
so if you have strong opinions about what helps beginners understand topics or what
worked/didn't work for you in the learning process this is your chance to change the
next release of the product. Please respond with your ideas, and if you have no ideas
please let me know what you did or did not like about the .NET Framework Quickstarts,
the 101 C# samples and the C# How-to articles.


Comments (22)

  1. Shannon says:

    The ASP.NET Starter Kits were a big help when learning .NET, so I would vote for fully functioning applications.

  2. Iain says:

    The main thing I want to see is really nasty. I want a really good index of where to find information on what. For instance, I’ve needed to find the following information:
    * the right way to make database data available in an application, which includes:
    ** the type of database accessing (Object-relational mapping or datasets)
    ** how to make sure database connections are available at the right times
    * how to write code to authenticate to a windows domain (why isn’t this in the framework? I don’t see why I shouldn’t be able to supply a hostname to connect to, a domain to authenticate in, and a username and password, and be told if that’s correct or not. I’m sure I’m missing some details, but I thought the advantage of a framework was that other people spent ages worrying about details)
    * How to get every page in an application to have a common header and footer

    Some of these I managed to find with google, some I just improvised an approach, and for authentication I eventually found (after I’d given up and used ADSI, which has some niggly bugs for this purpose).

    So I got information from a bunch of places. I’m sure that there are relevant samples and documentation provided, but I couldn’t find them. I really wish there was an exhaustive index, so I would look up authentication, then look up "to a windows domain" underneath that, and see both that ldap article and stuff about integrated authentication.

    I don’t much care about what form the things take – I want a good way to find the damn things!

  3. Stephane Rodriguez says:

    Samples for MFC veterans. Don’t get me wrong, i am not talking interop here. It’s about showing how the code molds from the MFC-point of view to the C# point of view, especially (but without restriction) when it comes to UIs, especially winforms.

    I can’t see a single article on earth saying that this.Handle returns the HWND of the underlying window, and that the window is created upon this call. This is of importance to understand the life cycle of the underlying objects.

  4. Scott says:

    It’s too late for me now but…

    Any examples of DataBinding that don’t use the DataGrid. The DataGrid, when using custom paging, is no better than the DataList or DataRepeater to use. More examples in the DataBinding articles and samples of DataBinding to non-ADO.NET objects.

    Examples of using a class that inherits and extends GenericPrincipal in ASP.NET applications. Man that was a learning curve "You mean that I have to capture the OnAuthenticateRequest event and put my custom object in HttpContext.Current.User EVERY REQUEST. Oh, and since the browser first sends a request w/o the auth headers it fires TWICE?! AND I don’t have access to the session objects (which occasionally vanish?!) in those Application events? Big learning curve there in terms of the Framework.

    The #1 thing I think would help out people new to the framework: Have someone re-work the $#@%^ error codes to return messages that are more germane to the situation. For example, if I have a class with a public field ("foo") and I’m trying to databind it to a control, the error message I get tells me the "class does not contain a member named "Foo"" instead of saying "I couldn’t find a public property named "Foo"", knowing the context (DataBinding) and the fact that the DataField looks for public properties only and can’t use public members, it should be possible to return an error message that tells me what the actual problem is.

  5. I would like to see examples of creating custom widgets from scratch.
    It’s always nice if sample code always came wrapped in a full sample application. Unless the code is simply an example of API usage.

  6. Peter Stuer says:

    A complete scenario sample around the PKI. Certificate support is new and great samples/documentation would be extremely valuable. What would rock would be a full application security scenario based on .Net, Smart Cards and Certificate Services.

  7. Anything regarding design time support. That subject hasgot almost no attention in the MSDN so far.
    Also quickstart samples for Compact Framework could be nice, speaking as a CF veteran.

  8. Phil says:

    My 2 cents:

    1. Security samples (both .NET and NT security)
    2. Interop samples
    3. Networking and Multithreading samples
    4. Design patterns samples.
    5. OS interoperability samples.

  9. John Morales says:

    Eric G. had a blog post about this last week, you should see that conversation as it directly relates to yours.

  10. Pete says:

    As a relative newcomer to C# I’d like to bring up a few points based on my journey so far:

    First of all, the biggest peeve I have with much of the documentation, is that it is written on the premise that the reader is already familiar with the concept being explained. So much of the documentation and/or tutorials assume familiarity with the terminology that it becomes overwhelming very fast. If I were familiar with it I wouldn’t be looking it up.

    Quick Reference:
    When providing a code example of how a certain function, keyword etc. is used, I think it would be very helpful to design a very simple construct to plant the idea of what it is (often the examples seem very elaborate and can obscure the objective of teaching that item). Then provide an example showing its “best practice use” (if one can be shown). Finally if appropriate, show examples that explain the “why” of some item or thing as opposed to just that it exists. Sometimes some history or context is just what is needed to help make it clear. And this one is really annoying; I found a page that showed code of how not to do something without also including an example of the proper way to use it.

    In Depth Examples:
    I find that the best tutorials have a quality, which can easily be brought into all the documentation. When showing code examples, it would be very instructive to have substantial amounts of code commentary. This works better than accompanying text because the comments are right there, in context with the code they are describing. Not just what something is but why it was used. Let’s transfer some of that experience to the student user as well.

    And finally, for me, the most instructive examples of code have been small applications that really show how everything can work together. This is closest to a real world translation of the simpler example code snippets in the documentation and tried and true implementations which I can use to help construct my own applications.

    Ok, thanks … Whew, just had to get that all out 🙂

  11. Simon Sheffield says:

    Some sort of ‘patterns and practices’ for Generics. Not being a C++ veteran i never really used templates that much, but got the impression there was some very funky stuff that could be done with them.

    For instance i seem to remember seeing various things in the ATL such as classes inheriting from templated base classes and stuff like that.

    I’m sure there are several design patterns that make use of generics and it would be great to see somtehing like this in the samples.

  12. Mark Hurd says:

    Whatever samples you provide, please try to not just convert the C# sample to VB.NET, or vice versa. It may be fair enough, inevitable and perhaps even instructive for API examples, but sample solutions should be designed and written from scratch for each .NET language.

    By all means compare the resulting solutions afterwards so that instructive comparisons can be made, but the variation between a C# solution converted to VB.NET and a ‘pure’ VB.NET solution is often significantly different. (And vice versa, I’m sure, if it ever happens.)

  13. Rajamannar says:

    Aha.. That’s a good question….. Here we go …
    What I would expect from you ??

    1) More examples on Data structures… because we can do lot of things using generics. Particularly how to implement B-Tree , AVL Trees and other stuffs in Data structures.

    2) Developing an application without using any GUI. For example like Al Stevens PARODY application.

    3) More example on Design Patterns . This examples should be like in Gamma et al.

    4) How to create a complete parser using C# . May be this should be like Building Parser using Java by Metsker . Of course we can reverse engineer that code. It won’t be nice to copy from his code.

    5) Your examples should be stright forward like The C# specifications examples. Just tell what is needed. No more stories. We can’t read all the pages.

    6) The importance should be given to the language rather telling about the fetaures of .NET.

    7) There is one example in the current .NET Framework. Creating a language called myc . You can explain its internal workings. Rather we hack. Of course when we hack we learn , but this would be nice

  14. Matt Hollingworth says:

    Albeit a minor thing on the whole scale, I found the quickstarts did not provide any examples of connection strings to databases through a .net SqlClient Connection which did not use windows authentication. The format of the connection string is different in .net to normal ado so it was a bit tricky to get this right as I couldnt use my previous technique of creating a .udl file!!

    The only other thing so far I found a bit frustrating was not enough examples of forms authentication / explanation of how you can get this to work with your database.

    Other than that I found the quickstarts are most usefull and very handy to this day. The class browser sample application also serves a whole use of its own so it should be promoted!! Not enough developers seem to know about this handy little thing and how many need to search for a class! Which brings me to think you should add a search feature to it too – that would be very usefull.

  15. Having complete applications, like the Terrarium game, is very helpful. The small examples in the existing SDK documentation are also quite helpful. More of both kinds of examples would be good. The more diverse, the better.

    A specific kind of example I’d like to see is an involved data structure example where attention is paid to efficiency.

  16. ahmad Al-mustafa says:

    I have mathematical application (algebra probabilities calculator).

    and how to functionally draw table (use mouse wheel to scroll it , ‘scrollablecontrol’)

    and how to set VHscrollbar ‘maximum,minimum values’

  17. stonie says:

    hello, im trying to learn C#. Right now im trying to figure out how do i change a caption or get the caption from another window like IExplore. sorry for posting in an odd place.

  18. Amateur Dev says:

    Where can i find a whidbey download to test

  19. Prasanth,

    The easiest way to test/evaluate Whidbey is to download one of the new Express products. The Express products are simplified, lightweight versions of Express designed for non-professionals and students and are available for download on the web at You can also get an MSDN Universal subscription which includes the full version of Visual Studio 2005 (aka Whidbey).



  20. Dude says:

    Rajamannar, check for data structures such as AVL trees and binary search trees.

  21. bloggdad says:


    I have problem with enter to this site via GPRS WAP.

    Please, help me.


    Best regards.

Skip to main content