PC Review


Reply
Thread Tools Rate Thread

Best practice and considerations in choosing source for an <ObjectDataSource>

 
 
ajmastrean
Guest
Posts: n/a
 
      6th Jun 2007
Folks,

What are the best practices, pros/cons, performance, scalability
considerations in choosing the source/type for an object's
ObjectDataSource (consider a GridView that needs to display a SELECT
statement from a table external to the website).

I have identified several alternatives...

1. Use a custom or pre-built data access class to provide SELECT
functions

2. Create DataSets for each SELECT statement, storing them in App_Data

3. Configure a connection to the database through the config wizard

 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      6th Jun 2007
"ajmastrean" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> What are the best practices, pros/cons, performance, scalability
> considerations in choosing the source/type for an object's
> ObjectDataSource (consider a GridView that needs to display a SELECT
> statement from a table external to the website).
>
> I have identified several alternatives...
>
> 1. Use a custom or pre-built data access class to provide SELECT
> functions
>
> 2. Create DataSets for each SELECT statement, storing them in App_Data
>
> 3. Configure a connection to the database through the config wizard


IMO, none of them.

4. Use a DAL instead, create a DataSet or SqlDataReader object and do your
databinding in code-behind:
http://www.microsoft.com/downloads/d...displaylang=en


--
http://www.markrae.net

 
Reply With Quote
 
ajmastrean
Guest
Posts: n/a
 
      7th Jun 2007
Mark,

I think we have a bit of communication confusion...

Item 1 was actually a reference to the data access application block
(albeit, version 3.0). While this alternative is doable (in fact, my
prototype is using it), are there issues to be concerned with? For
instance, what if I want to use strongly typed data sets? I have to
create objects using the app block _and_ data sets and then fill the
data set from the LoadDataSet method.

Is using a strongly typed data sets and table adapters to do the
querying better? Is running straight SQL against a connection string
(using the Object Data Source Wizard and choosing Database) faster?

These are the things I am interested in.

 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      8th Jun 2007
"ajmastrean" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> I think we have a bit of communication confusion...
>
> Item 1 was actually a reference to the data access application block
> (albeit, version 3.0).


My apologies - I didn't read your OP closely enough...

> While this alternative is doable (in fact, my prototype is using it), are
> there issues to be concerned with?


None that I can think of - I never use anything else...

> For instance, what if I want to use strongly typed data sets?


That's what the LoadDataSet method is for...
http://www.google.co.uk/search?hl=en...strongly&meta=

> Is using a strongly typed data sets and table adapters to do the
> querying better?


Better in what sense...?

> Is running straight SQL against a connection string (using the Object
> Data Source Wizard and choosing Database) faster?


No.


--
http://www.markrae.net

 
Reply With Quote
 
ajmastrean
Guest
Posts: n/a
 
      13th Jun 2007
I have been investigating enterprise architecture for an application
like this...

Presentation <-> Business logic <-> Data access <-> Database

My issue is mainly between the Business logic and Data access layers.

1. I can have Visual Studio create strongly typed DataSets
with the connection strings, select/update queries built in,
and enforce logic with properties... all without writing any
code!

2. Or, using a Data access class, I could stop the DataSet when
moving up or down the layers and enforce the business rules there
(check values, allow or deny updates, enforce min/max values).
<http://weblogs.asp.net/rosherove/archive/2003/07/28/10607.aspx>

3. Or, I can use the wizard-built DataSets, intercept the
TableAdapter
class in another class, intercept the DataSets, and enforce
business
rules there.
<http://www.asp.net/learn/dataaccess/tutorial02cs.aspx?tabid=63>

And all 3 of these methods can be bound to controls and manage the db
connections properly.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing a form’s record source alex Microsoft Access 3 24th Mar 2010 07:05 PM
Row source Best practice?? Barry A&P Microsoft Access Database Table Design 7 3rd Oct 2009 02:09 AM
Public Read-Only Fields - Best Practice Considerations Smithers Microsoft C# .NET 4 8th Aug 2007 03:59 PM
ObjectDataSource -Parameter Source Session Alejo Microsoft ASP .NET 0 2nd Feb 2007 08:22 PM
Best practice choosing between sub-form, continuous, etc. =?Utf-8?B?WFA=?= Microsoft Access Forms 3 25th Jan 2007 11:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 AM.