Can Strongly Typed DataSet contains Stored Procedure Wrappers?

  • Thread starter Thread starter Jon B
  • Start date Start date
J

Jon B

Hi There!

I'm looking into Strongly Typed DataSets in the .NET Framework. I know it
can generated strongly typed tables as objects and column names as
properties.

However, one thing that I would like to know is if it wraps database Stored
Procedures as methods and functions? For instance, if I have a Stored
Procedure called SelectBestProduct in the Product table, would I be able to
call the Stored Procedure with
Product.SelectBestProduct() statement and get DataReader or DataTable
returned?

Thank you all in advance!
Jon
 
Yes, you can but not with strong typed dataset - std doesn't interact with
database.
Perhaps with its strongly typed dataadapter or standalone one.
 
Hi Jon,

In the 2.0 framework that can be done using TableAdapters. TableAdapters
can be configured in the DataSet designer.

"TableAdapters"
http://msdn2.microsoft.com/en-us/library/7zt3ycf2(VS.80).aspx

And since the DataSet, along with each Typed DataTable and DataRow are all
partial classes, you can extend them in code without having to worry about
the DataSet designer replacing it at a later time, as in previous versions
of Visual Studio .NET. e.g., you could add a "FullName" property to a
DataRow that contains information about a person. The property could return
the concatenation of two columns such as FirstName and LastName, or even
execute a stored procedure in the database and cache the result.
 
Back
Top