473,385 Members | 1,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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

Jun 6 '07 #1
4 2810
"ajmastrean" <aj********@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
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

Jun 6 '07 #2
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.

Jun 7 '07 #3
"ajmastrean" <aj********@gmail.comwrote in message
news:11*********************@h2g2000hsg.googlegrou ps.com...
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

Jun 8 '07 #4
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.

Jun 13 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ~john | last post by:
I have an ObjectDataSource pointing at a class, which based on the SelectMethod and the parameter passed to it, returns an Object of my custom class. The SelectMethod is something like...
4
by: GaryDean | last post by:
I have an objectdatasource reading a dataset and I have a gridview using that objectdatasource (at design time). It binds fine but I need to clear it. myGridView.DataSource = null:...
2
by: MikeB | last post by:
Hello All, how can I set my selectparameter to a constant value within my constants class or to a value in my web.config file?
1
by: Jonathan Wood | last post by:
I see that I can create a List<stringlist and bind it to a GridView control (by setting the DataSource property to the list and calling the DataBind method). What's the trick to doing the same...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.