Tuesday, February 14, 2012

Best Way to Handle Data Access

This may be a loaded question, but I was wondering if anyone could outline the main options we have available to us for handling data access with ASP.net 2.0 / SQL Server 2005.

I know at one extreme you can simply use the Data Controls like GridView, FormView, and DetailsView, specifying the necessary SQL on a page-by-page basis. At the other extreme, my understanding is that you can basically set up a SQLConnection object, explicitly specify your SQL (or call a stored procedure) and then execute these items from within the code.

Can anyone either outline the main options or point me to a resource that better explains this? Thanks!

Josh

This is an awfully tall order for a forums question. I suggest you take a look at theData Access section of the ASP.NET Developer Center. Or hit upGoogle.|||

Thanks for the prompt reply; this looks like exactly the kind of resource I was looking for. My suspicion is that for relatively straightforward data models you can just use the DataControls and write a minimum of code. I'm guessing that for more sophisitcated apps, you'll have to write a data access layer of classes which maybe calls the Stored Procedures so that you wind up using the ObjectDataSourceControl? I may have made some statements here which really don't make sense.

If I come to any reasonably straightforward or simple conclusions, I'll make sure to summarize them here. Thanks again!

Josh

No comments:

Post a Comment