M
matt
hello,
i am building a data-driven website in ASP.NET 2.0, using "Visual
Studio 2005 Express Web Edition" (phew!).
w/ 1.1, my i normally have my business objects call a data access
layer. for instance, the "/App_code/Restaurant.cs" object's
insert/update/delete methods will call my
"/App_code/DA/restaurantDA.cs" class' functions. inside of
"restaurantDA.cs" i build up command/connection objects, pass in
params, get back datasets, etc.
however, in 2.0, i see that one can use VS2005's "Add DataSet" designer
to build datatables. this is done via the "/App_Code/foo.xsd" file,
using a wizard -- you point it to your db instance, then point to the
procs you wish to use for populating your tables.
using this method, it would seem one can trim nearly all the typical
verbose SQL data access code, and use instead just two lines:
public static DataTable GetRestaurant(int restaurantID)
{
FooTableAdapters.Restaurants adapter = new
FooTableAdapters.Restaurants();
return adapter.GetRestaurant(restaurantID);
}
....and bam, you now have a datatable in *two lines* of code! now, my
question -- should i?? i have no idea if employing this new wizard tool
in VS2005 is a good idea. i dont know how heavy or light these objects
are compared to the typical verbose SQL code (building up
command/connection/parameter/dataset objects, etc).
can anyone speak to this?
thanks!
i am building a data-driven website in ASP.NET 2.0, using "Visual
Studio 2005 Express Web Edition" (phew!).
w/ 1.1, my i normally have my business objects call a data access
layer. for instance, the "/App_code/Restaurant.cs" object's
insert/update/delete methods will call my
"/App_code/DA/restaurantDA.cs" class' functions. inside of
"restaurantDA.cs" i build up command/connection objects, pass in
params, get back datasets, etc.
however, in 2.0, i see that one can use VS2005's "Add DataSet" designer
to build datatables. this is done via the "/App_Code/foo.xsd" file,
using a wizard -- you point it to your db instance, then point to the
procs you wish to use for populating your tables.
using this method, it would seem one can trim nearly all the typical
verbose SQL data access code, and use instead just two lines:
public static DataTable GetRestaurant(int restaurantID)
{
FooTableAdapters.Restaurants adapter = new
FooTableAdapters.Restaurants();
return adapter.GetRestaurant(restaurantID);
}
....and bam, you now have a datatable in *two lines* of code! now, my
question -- should i?? i have no idea if employing this new wizard tool
in VS2005 is a good idea. i dont know how heavy or light these objects
are compared to the typical verbose SQL code (building up
command/connection/parameter/dataset objects, etc).
can anyone speak to this?
thanks!