BLOGS BY TOPIC
BLOGS BY AUTHOR
BLOGS BY YEAR
Yes, ASP.NET provides DataSource controls, but wizards only get you so far. Share the secret of how Wise Owl create all our ASP.NET websites, using a single, simple data class.
- Data Classes in ASP.NET (this blog)
- Our Example for this Data Classes Tutorial
- Storing and Retrieving Connection Strings
- ADO.NET: DataSets, DataTables and Data Adapters
- Consuming our Data Classes
- A Class to Run a Stored Procedure and Return its Rows
- Consuming our Data Class on the Web Page
Posted by Andy Brown on 07 August 2012
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Data Classes in ASP.NET
This online tutorial shows how to create and use all the data classes in ASP.NET that you'll need! Example code is given in C# and Visual Basic.
Should you Read this Tutorial?
If you're going to read and make use of this blog, it's important to realise who it's aimed at. There are 3 types of software user:
|The stickler||This person prefers to code in C, because it's a proper programming language. He (because sticklers usually are male) does everything the correct way. Not only does he have a book on ADO.NET Unleashed on his bookshelf, but he's read it in its entirety.|
|The Hogwartian||This person uses all the wizards provided by Microsoft, to make his or her life easier. S/he often runs into the limitation of wizards, and so is usually a dabbler in software rather than a guru.|
|The business user||This person is using software as a means to an end, rather than for its own sake. S/he will learn as much as s/he needs to know to create a software application, and no more.|
This is a bit of a caricature, but it will help you decide whether to read on. This blog will:
- Infuriate the stickler; and
- Bewilder the Hogwartian.
It aims, however, to be exactly what the business user needs.
The blog will use SQL stored procedures throughout - if you don't know what these are, read my earlier blog on stored procedures to find out!
The rest of this blog is divided up as follows:
- Explaining the example we'll use.
- Understanding, storing and retrieving connection strings.
- Giving the rest of the background theory that you will need on data tables, datasets and data adapters (and only that!).
- How we'd like to consume our data classes.
- Creating our class to return a table of data.
- How our class is used on the web page.
There's a lot to cover, so let's make a start by looking at our example, which is -as ever - to do with movies.