When should you use web services and when should you use ObjectDataSource?

I am unclear as to when it would make sense to encapsulate your database queries in a web service and when you would choose to use an ObjectDataSource control?

I have an app that uses a web page to display data from an sql server 2005 database. Up until now I have been using an SqlDatasource with in-line sql queries. This is very direct and clear interms of binding and dta column names and feeding parameters into the datasource queries.

However, in my attempts to align with larger scale implementations I thought it was sensible to consider web services and data access layers. However, I am really not sure what factors decide the direction that should be taken?

Notes-
(i)I am aware that sql server 2005 can publish certain queries as web services.
(ii)I am presently using the 'cache invalidation' capability to ensure my data is fresh whiclst limiting database queries. I am unsure if this capability is completely lost or not when moving away from an SqlDataSource?
(iii)As outlined, I have been using the SqlDataSource in my code and this allows a very direct link to the database data. What capabilities are lost when using-
   (a) Using an ObjectDataSource control object in place of the SqlDataSource control?
   (b) Using  web service to deliver the data instead of using the SqlDataSource comtrol?

 

0
jimbeattie
3/16/2006 8:53:10 AM
asp.net.object-datasource 16182 articles. 0 followers. Follow

3 Replies
686 Views

Similar Articles

[PageSpeed] 30

Hi Jim

I think you first need to understand that datasources such as SQLDatasource and web services are not of the same species.  Datasource objects supplied by APS.NET, and other languages, are interfaces to your own database.  A web service is basically a structured layer providing information from your database to other people's web sites.  For example we could use the Amazon web services to read their catalog of products and display them on our own web sites.

When interacting with your own SQL database from your own web pages ASP.NET 2.0 gives you two components -  1) SQLDatasource and 2) ObjectDataSource components.  There are others listed here http://www.asp.net/QuickStart/aspnet/doc/data/default.aspx .

SQLDatasource is the quick method component but ObjectDataSource the more flexible ( so flexible I can't get bits of it to work yet ).

Stevo

 

0
emulti
3/16/2006 10:03:48 AM

So I think I should be using an ObjectDataSource in the longterm.

If we continue along this path, why it is useful or advisable for sql server 2005 to publish its queries as web services? It would seem preferable that you encompass your database sources as ObjectDataSources,(or similar), and that publishing them as webservgices is actually adding a level of abstraction that isn't really helpful in most cases.

0
jimbeattie
3/16/2006 11:40:33 AM

I cannot comment on SQL Server 2005 functionality only to say that the Microsoft future internet strategy is very Web Services based whereby many computers are acting as providers of information to consumer web sites.  This is probably why SQL Server 2005 is designed so.

But most in house systems are still very solitary in their design (i.e. one client to one data server) with overnight feeds between them.  It all depends on what kind of application you are providing.  If it stores information that needs to be protected then making it accessible via web services is probably a bad policy.  If it's information that online customers need to access then a web service makes sense, particularly if you sell through many agents.

So it really all boils down to what is the minimum relationship you need between your client interface and your database. 

 

 

0
emulti
3/16/2006 5:53:37 PM
Reply:

Similar Artilces:

change a web reference to a web service in the config file of an object used by a windows service
In my solution (visual studios 2005), I have a windows service and a business object.  The business object has a web reference to a web service.  I maid the web reference dynamic and it created an applicationSettings section in the appconfig:<configuration>           <applicationSettings>        <Objects.Properties.Settings>            <setting name="Objects_LookupService_auth"        &nbs...

Need help with deciding to use or not to use web services in a web application
Hi all, I haven't used web services at all in my web application development and now I was asked to use web services in my web application.  I was a novice in ASP.NET since I'm just changed to ASP.NET from a Java background. I used the tutorial on MSDN to create the DAL (which is a .xsd file type) and the BLL layers and it works pretty well for what the web application suppose to be but since I was asked to add a web service layer to this, I wonder how to do it?  And I wonder if it is necessary to have an additional layer?  What is the pros and cons for adding the we...

To use or not to use (web services / EAServer)
We (TSD) are developing client/server applications with PB for many years now (starting with PB 3.x). Now we are using PB 8.03 with ASA 8.02. In our PB applications we do have some business objects in seperate libraries. They consist of a datastore with a lot of functions. Functions do sometimes call visible objects. The last few years we see that users are more and more asking for Internet and PDA solutions. To prevent double source codes we like to have the same objects/functions for the 'old' client/server information and for the internet and PDA solutions. In our opi...

Synchronous use of a web service is useful?
I was curious if a web service adds any value when its called 'synchronously' from an ASP.Net application. Both the web service and ASP.Net application are within an enterprise's internal network and on separate web servers. I would think the web service would add no value, but  instead lower the performance in above scenario. True or false?sun21170 Yes.I agree with you. It seems that the only time when a 'synchronous' web service would provide value is when one or both of the following features are needed:n-tier architecture needs to implemented. n-tier developm...

Can a .net web service return a crystal report .rpt object to use as a report source?
I would like to have a .net web service return an .rpt object to use as a report source for the crystal reports viewer on a thick client (windows .net form). Is this possible? The documentation -- the lack of it, actually -- on this subject seems to indicate no, but I'm not that familiar with the standard deployment schemes. I don't want to create the reports as web services, because they will be created on the fly by users without vs.net, and I'm also restricted by security concerns from putting new software (e.g., report server, merge modules, et al.) on the server that hosts the ....

How to use Struct in Web Services using VS2005
Hi All, I am developing a web service which recieves the information from the client application and will store those on the SQL Server database. For this purpose, I would like to use C#.Net "struct". This is not visible from the client application. My question is how to make this struct as visible for client application. Please Help me. Code: public class Service : System.Web.Services.WebService {public Service () { [WebMethod]public string sampleMethod() {return "Sample Text"; } public struct testStruct {public string strOne;public string strTwo; } ...

Using ATLAS without using Web Services
1. Is it possible to use ATLAS by some way so that we dont need to create any web services.2. is their any way to create a dummy page on the server and put all the functions into it, which we need to call through ajax on server side and then call those pages with some kind of query parameter so that it can understand which method or function need to be called and thus returns the result asynchronously.thanks and regardsgoru 1. Absolutely, though you'll find your self writing a lot more javascript, one way to do it is using the objects/functions defined in the AtlasRuntime.js, which act as ...

How to use net use?
Please can any one tell me how to use the dos command net use properly? I have read the help but can't seem to get it to work. Keep getting sytax error message. Thanks in advance. "Beowulf" <who-knows@no-one.com> wrote in message news:9krutk$puu$1@news.grc.com... > Please can any one tell me how to use the dos command net use properly? > > I have read the help but can't seem to get it to work. Keep getting sytax > error message. what are you trying to do? There are about 50 options to "net use" that do a ton of different thin...

Consuming a .NET web service in Delphi 2010 using a service reference
Hi, I've been asked to modify one of my existing applications (D2010 Win32) to interact with a web service written under VS2010/.Net 4. The information I have so far is :- "As communication is secured by .NET WsHttpBinding data encrypting, In order to consume it you have to add to your application a Service Reference (not a web reference) that joins the service available at the URL: http://ctm.mobilling.it/SmsComApi/Sms.svc . Assuming that the binding created in your app.confing is named "WSHttpBinding_ISms" you have to instantiate a client as shown below: {c...

.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

Using ObjectDataSource with Web Service
Hi I am playing around with ASP.Nett 2.0  and VS 2005 Beta 2, and I am currently having a little when using the ObjectDataSource method to accesss a web service which returns a strongly typed dataset.The web service works fine when i populate the GridView manually, so I know the web service works.  Im using the following code to do it manuualyDim ds new dsMyDataDim ws as new myWebService'set securityws.PreAuthenticate = Truews.Credentials = System.Net.CredentialCache.DefaultCredentialsds = ws.getjPaymentPlans(ctrl)GridView1.DataSource = ds.PaymentPlanGridView1.DataBind()Howeve...

Consuming Web service from .net 3.5 web application using ajax
Hi , Before in .net 2005 ,I use to consume the  web service from client side via Ajax and java script. that's just adding web service inside the script manger services.But  it was not possible with .net 2008 version WEB APPLICATION   , Even it works well with .net 2008 web sites. Please help me to solve the issue. I have no idea what you mean. Please post the code that "does not work". NC...   I have the same problem.  I have a .NET 3.5 Web Application not Web Site.  I fully qualify the web service with the namespace i,e,  &n...

Changing URL in web.config for web service
I added a web reference to asmx file. In web.config - it adds - undefinedadd key="CoreService.CoreServices" value="http://test/CoreServices.asmx I then change it to <add key="CoreService.CoreServices" value="http://test2/CoreServices.asmx"/> But CoreService.CoreServices still looks for http://test/CoreServices.asmx.  What else do i have to change? I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ So no ...

What would I used if I didn't use a Web Service?
I have several maybe even dozens eventually of legacy systems that need to export XML so that a webconsumer can read them all and put them all in one document. I want to read from system A, B, & C...none of them are the same OS (and assume for a moment they can build a web service to export to the XML schema I am using), and they must all be retrieved into one web page.  I do not have access to all of the directly, but have people on the other side who can build a service.  What do you think?  Is this a good candidate to use Web Services?  I don't know what else I wo...

Web resources about - When should you use web services and when should you use ObjectDataSource? - 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
Archive - Forever Breathes The Lonely Word

Resources last updated: 12/24/2015 8:41:44 PM