You all read about the buzz and the fuss about ADO.NET 2.0 TableAdapter, how easy and powerful it is, how coll e.t.c. One of the most intriguing features is to be able to have multiple TYPED Fill methods for a given TableAdapter.
Google it, and you will be surprised about how many people are talking about it, bot nobody is telling "how"..
I will skip the details about how to create a DataSet in Visual Studio 2005 , because that can be found very easily.
- Open your DataSet designer in Visual Studio 2005.
- Right click the TableAdapter
- Select Add > Query
- Follow the steps in the TableAdapter Query Configuration Wizard
You will see how easily you can get multiple fill commands for your TableAdapter.
To summarize the benefits, for the very same table, you get strongly typed, parametrized methods such as :
FillByID(ID as integer) as integer
FillByName(Name as string) as integer
FillByCategory(Category as integer) as integer
FillByCategoryStatus(category as integer, status as string ) as integer
So that you do not need to worry about the data types or the number of parameters in the stored procedures when calling them anymore. You have your function defined with the correct number of parameters and corresponding .net DataTypes, buolt in right into the typed dataset you just created :)
Hope it helps