David Gristwood's Blog

Azure, Azure, Azure

Data Binding with ASP.NET

I am presenting the session on Building Data-Driven Websites with ASP.NET (a.k.a. Data Binding and ASP.NET) at the current Microsoft Technical Roadshow we are running in the UK, so I though I would use my blog to provide some additional links and background material for the session.


The good news is there are plenty of articles on this topic, from the core .NET framework documentation and the quickstart tutorials that get installed in your machine, through to the MSDN ASP.NET Developer Center and the Microsoft ASP.NET site.


One person who has written more than his fair share of articles on this subject is Dino Esposito. For example, he covers the subject of templates, which is one of the core topics of my session extremely well in his MSDN article Understanding Templates in ASP.NET. I use some variations on his demos in my session. I do mention the three templated controls, the DataGrid, the DataList, and the Repeater – if you want a more in depth treatise on when to use what, check out Scott Mitchell’s article Deciding When to Use the DataGrid, DataList or Repeater.


I also discuss the choice of DataReader versus DataSet. Most of my demos use DataSets, simply because I like them, and they are powerful and easy to work with, but that doesn’t mean that they are the right choice for you. If you are developing large or complex web applications, I would suggest you do some background reading on this topic, such as the recent MSDN article Contrasting the ADO.NET DataReader and DataSet, which lays out the pros and cons.


Finally, a task I leave as an exercise for the reader, you might want to consider writing your own ASP.NET control which supports data binding and templates. Dino Esposito has written an article entitled ASP.NET Controls Templates which takes you through the process. Happy coding!