What kind of benefits are there to use ObjectDataSource control instead of SqlDataSource control?

I have learned some Starter Kits such as Personal WebSite Starter Kit, Classifieds Site..., I find these programs always use
ObjectDataSource control as the datasource of DataList, GridView and write down many additional codes. I think that it will be simple if use SqlDataSource control.
I can write some Stored Procedures with parameters in SQL 2005 database and select StoredProcedure from SelectCommandType in SqlDataSource control,
so I think I can do the same work either ObjectDataSource control or SqlDataSource control if I only handle SQL 2005 database.

I know ObjectDataSource can handle custom data but SqlDataSource only handle SQL database.

Why do we want to use ObjectDataSource if we only handel SQL 2005 database?

Maybe one reason is less coupling between Business Layer and UI when I use ObjectDataSource control, but I think it also is less coupling even if use SqlDataSource because SqlDataSource only effect UI layer and Database Layer


Many thanks!

SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip files

SuperCool Random Number Generator
8/9/2006 8:22:17 AM
asp.net.object-datasource 16182 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 7
Get it on Google Play
Get it on Apple App Store

I don't think you want to use the ObjectDataSource control instead of the SqlDataSource control but instead use it in addition to the SqlDataSource control. I personally use the SqlDataSource control for most of my SQL interactions, but I use the ObjectDataSource control to access specific business logic where I may or may not be accessing a SQL Server database.

For instance, when I want to display a GridView displaying all of the users for my application, I simply use a ObjectDataSource which uses my Users business logic class to retrieve all users from the current membership provider.

Thanks, Ed

Microsoft MVP - ASP/ASP.NET

8/9/2006 2:40:06 PM
I think that almost business logic can be done throught Stored Procedure in SQL 2005, so SqlDataSource can be used for most of my SQL interactions, but why don't many Starter Kits use SqlDataSource control?
SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip files

SuperCool Random Number Generator
8/9/2006 2:56:49 PM
I'm not sure why. Like I said, I use both. Everyone has a preference, and whoever developed these starter kits must have wanted to use their own data access layer and hooked it up using an ObjectDataSource control.

Thanks, Ed

Microsoft MVP - ASP/ASP.NET

8/9/2006 3:42:56 PM

Similar Artilces:

Custom Datasource Controls Vs. Object Datasource Controls
Hi folks,I am a web developer developing pages in the project. I need to integrate the front end pages with the backend API. Active directory is being used as the database system for our project. I only use the API and the methods offered by it to interact with the data.For all the operations on the data, I have methods that I can call from the API (viz. Create(), Delete(), Modify() etc.). For connecting the data to my frontend data controls (viz. GridView, DropDownList etc.) I can use Object Datasource Control. I also read some articles about Custom Datasource controls. Now, I am having a d...

Using Data Controls Without Using ObjectDataSource Control
Hi, I've been looking on the Internet for a tutorial that would show me how to use the data conrols (FormView, GridView etc) without using an ObjectDataSource (or any other data source control).  The reason is that I want to use a formview and gridview from within another formview control to create a single form  that would allow me to insert, update and delete an order and its order details at the same time. I thought that this could be achieved by having a DataSet containing two DataTable objects in the code-behind with the Order DataTable containing one row to repres...

code for Custom paging without using sqldatasource control and sql datasource control for gridview...........
 code for Custom paging without using sqldatasource control and sql datasource control for gridview...........i need code for how to show all pagenumbers in gridview with custom paging in gridview..............It is very urgent................................. T.Ashok Kumar  suppose that we have a table like thisCountryId  identity intCountryTitle    nvarchar(50)you can use this sql command for paging the dataUSE [CyberOffice]GO/****** Object:  StoredProcedure [dbo].[CountryGetListPaged]    Script Date: 09/17/2008 14:01:06 ******/SET A...

What control do I use (or do I not use a control at all...)
Okay so here's the story so far. I am making a blog to be incorporated into a website. Well, I'm doing the blog from scratch. I'm using MySQL to source all the data via MySQL .NET/Connector. Now while developing the script, I used DataReader and Response.Write to show the blog topics. Now that it has come to put it under a design (I'm using a Master Page for that), I've hit the problem. Response.Write shows all the topics before any of the design elements could be incorporated. So that (more or less) is out of question. So next I looked into the data presentation controls. I looked up GridVi...

Using ADO.NET instead of the DataSource controls in Visual studio 2005
I am using VS 2005 and SQL server 2005. We will have several web forms which are populated with data from our database. The web forms have various controls that will be bound to the data which is extracted from the database. For example, a drop down list box, etc. I have noticed that in ASP.NET 2.0 that they have several built in Data Source controls. For example, SqlDataSource control, ObjectDataSource control, XmlDataSource control, SiteMapDataSource control. I have looked at these controls but I don't like the fact that things are wired up automoatically through the Visual Studio wizard....

Modifing javascript to use server controls instead of using html controls
Hi, I use a Javascript to create a textbox that converts English to Hindi text. I am using it in my aspx pages. I use another javascript to access the Text of this HTML textbox.  Everything is fine when I use Single TextBox on a page. But the complexities go out of my control when i need to use 5 such textboxes on the same aspx page. Moreover I encounter issues of ID of ASP.NET controls that get changed as there are ContentPlaceHolders, TabPanels etc. I don't know the javascript things so deeply that I can comprehend the code that generates the custom Textbox. Now I ne...

Issue with getting values from child controls in a gridview, to use for the update using a SQLDataSource control
Hi all, I have a gridview bound with a SQLDataSource. I am using the Update feature of the SQLDataSource to update a SQL Server database with values entered into the gridview. However I am not getting it to work. I believe this is due to the controls that contain the user entries are not the gridview itself, but rather child controls within the gridview. I have been using the names of the actual controls but nothing happens. Upon submit, the screen returns blank, and the database is not updated. Here is some code:   <asp:GridView ID="GridEditSettlement" runat="server" AutoGenerate...

ajax.net controls used in custom composite controls?
I am creating an events calendar that uses the accordion to display the events for the selected day.  The problem I'm having is that the accordion is not responding to any client side events.  I would really like to find a good "How to" article for building composite controls that incorporate an ajax.net control like the accordion....

Want to used Standard Control instead of HTML control
hi, is someone can tell me how i can replace the following : Response.Write("<Image id=" & h & BBLOCK(j) & BID(j) & h & " src=" & h & GLOBAL_IMG_URL & BCONTENT(j) & h & "/><br/>") by the same in standard control (using Image). I've try to done it without succes. thanks  You'd probably have to define the image in your code-behind (or script if you're using inline code): Dim myImage As New Image() myImage.ID = whateverTheIDisSupposedToBe myImage.ImageURL = whateverTheURLIsSupposedToBe ' Then you need to put the image control i...

using a .Net Control as activex control in VCL form
Hi , We have a to integrate a simple .Dot CSharp control which needs to be integrated into bcb2010 VCL form as a control. We will place the control on the VCL form along with other VCL controls's. I tried creating a simple .net control using a lable+textbox and trying to use in vcl form. I have made the assembly comvisible and generated tlb files and .bpl for the component. I could see the component in "ActiveX" tool palette. But when I drag the object onto VCL form and try to access its attributes I run into problems. I am not able to see .net control on the vcl at runti...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

How to use FormView 's edit, cancel, insert and delete without using a control (Ex: sqldatasource, objectdatasource, etc..)?
I'm using C#, I cannot find any examples how to use edit, cancel, update, delete feature of the formview without using controls like objectdataSource/sqldataSource? I have 4 buttons (EDIT, SAVE, CANCEL, Delete), not sure how trigger the edit temple, insert template, etc... I would perfer to do it it programmatically. I would be grateful for any help!    if oyu want to change the Current Displayed Tempalte for the FormView , you can call FormView.ChangeMode as  follows:   ' put the FormView in edit mode FormView1.ChangeMode(FormViewMode.Edit)...

Page and Control Flashing Using AJAX Control Toolkit Controls
Page and Control Flashing Using AJAX Control Toolkit Controls I'm using IE7 and the ASP.NET AJAX Control Toolkit.  I'm using two controls -- Accordion and CollapsiblePanelExtender.  I'm actually using 2 CollapsiblePanelExtenders, and the Accordion control is inside one of the panels for the CollapsiblePanelExtender (see the code below). The problem I'm seeing is that when I click an Accordion pane to open/close it or click the CollapsiblePanelExtender panel to open/close the panels, the controls and page flash while the animation is in progess.  Everything el...

controlling an object in a web control from the page the web control is placed in
I have created a web control in vb.net that has an image button and an image. when it loads the image button is visible and the image is not. I want to be able from the page which "includes" the web control to set the image button to invisible and the image to visible. When I tried this, the main page didn't recognise the image button or the image (both < asp: objects). help would be gratefully appreciated. oh yeah, it's inline code so any code behind stuff will just confuse me ;) Some code please.-- Justin Lovell...

Web resources about - What kind of benefits are there to use ObjectDataSource control instead of SqlDataSource control? - asp.net.object-datasource

Forums Forums Database Error
This is a discussion forum powered by vBulletin. To find out about vBulletin, go to http://www.vbulletin.com/ .

Using The LINQDataSource
-*+There is a new datasource control available in Visual Studio that works in much the same way as the SQLDataSource and the ObjectDataSource. ...

ASP.NET Web Forms DynamicData FieldTemplates for DbGeography Spatial Types
... a FormView in ASP.NET Web Forms. Notice the ItemType is set, rather than using Eval(). We're also using SelectMethod rather than an ObjectDataSource. ...

LINQ Tutorials : LINQ Tutorials, Articles and Resources
Articles and Helpful Tutorials for LINQ and ASP.NET

About Mikesdotnetting
I started this site as somewhere to store answers to bits and pieces that I see asked frequently in the forums at www.asp.net . Rather than type ...

Runnable code for JQuery, Codeigniter, NodeJS, PHP, Python and more - Runnable
Runnable code for dart-vm, express, paypal, google, evernote, everyauth, ejs, rendr, CakePHP, php-mysql, php-facebook, codeigniter, imagemagick, ...

ASP.NET Pivot Table - RadPivotGrid for ASP.NET AJAX
... of all data reports. Try now! Use any declarative data source control (AccessDataSource, SqlDataSource, LinqDataSource, EntityDataSource, ObjectDataSource, ...

Miscellaneous « AJ\’s blog
AJ\’s blog January 28, 2012 2011 in review Filed under: Miscellaneous — ajdotnet @ 7:41 pm The WordPress.com stats helper monkeys prepared a ...

ObjectDataSource - Selectcount method with custom parameters and custom paging.
protected void obds_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { if (!e.ExecutingSelectCount) { e.InputParameters["filter"] ...

Archive - Forever Breathes The Lonely Word

Resources last updated: 12/8/2015 4:08:33 AM