I am from C# Winforms background and recently switched to ASP.NET in c#.
After working with Winforms applications along with BusinessObjects , O/R Mapping frameworks, and logical layering techniques for months, I am just wondering, should we actually use ASP.NET ubiquitous xyzDataSource controls?
We have our specific class-structures like: - class MyClass : IMyClass, IPersistant
-
{
-
public int ID {get;set}
-
.....
-
.....
-
public int SaveOrUpdate(){}//returns the ID
-
public static MyClass Get(int id){}
-
public static IEnumerable<MyClass> Get(){}
-
public bool Delete(){}
-
}
And also we have our own code generators for this type of classes.
Then what are xyzDataSource controls good for?
Why don't we just use our classes' IEnumerable<T> and manually bind data?
And also don't xyzDataSource controls only applicable for XP/Agile projects?
3 1262
First of all, you can have a look at this very useful link: http://msdn.microsoft.com/en-us/magazine/cc163862.aspx Next, there are plenty of usage of those datasource controls:
Here they are in nutshell:
SqlDataSource Retrieves Its Data From a SQL Server, Oracle, or other OLE DB accessible database.
AccessDataSourc e Retrieves Its Data From an access database.
ObjectDataSourc e Retrieves Its Data From a business object or method.(Like from your own class and methods)
XmlDataSource Retrieves Its Data From an XML file or stream (used for hierarchical data).
SiteMapDataSour ce Retrieves Its Data From an XML-based sitemap source (used for hierarchical data).
Lastly: using databases is one of the main and probably the strongest point of ASP.NET and without "ubiqitious " datasource controls how will you manage those databases?
@sanjib65
You didn't get me.
I was talking about BusinessObjects and O/R-Mapping along with ASP.NET.
Suppose I have a BusinessObject named 'Product' and it is O/R Mapped. Then, when I call Product.Get(), what should it return? Obviously IEnumerable<Pro duct>.
And if I want to use this BusinessObject named 'Product' in my asp.net code-behind, do I need SqlDataSource?
Now, answer my previous question again.
Frinavale 9,735
Recognized Expert Moderator Expert
I haven't really used the xyzDataSource controls very much either. They make binding to GridViews and other templated controls a little easier because they provide functionality for add/edit/deleting.
If you already have a Business Object implemented then use it because it doesn't make sense to start using xyzDataSources when you already have something implemented that does what you want.
-Frinny
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tat |
last post by:
Hello,
I have a weird show stopper here.
I created a Windows application (.NET 1.1). My dev. machine is not hooked up
to the Internet, neither it has firewall.
I installed the app on a different machine with Internet connection and
Norton Security Family Edition 2001.
|
by: Richard Lee |
last post by:
I would like to see what is the best possible front end and user
interface one can create with ASP.NET. I'm not so interested in the
backend since whatever goes on there will not be so obvious anyways.
Could anyone suggest compelling websites or web apps? Yeah, you could
mention a few Microsoft sites but I would really like to see how well
others have exploited .NET capabilities.
Thanks.
|
by: James Fortune |
last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't
understand why people who know how to write code to completely replace
a front end do not write something that will automate the code that
implements managing unbound controls on forms given the superior
performance of unbound controls in a client/server environment. I can
easily understand a newbie using bound controls or someone with a
tight deadline. I guess I need...
|
by: Steve Le Monnier |
last post by:
Is there any quick way of fixing combo boxes or radio buttons so that on an
enquiry screen its possible to read their contents. As they don't have
read-only properties the only method available is to use the enabled
property, but this given an almost unreadable GUI.
In the VB days we used to dock troublesome controls onto frames and then
lock the frames but this is not an option anymore. Does anybody have an
alternative tip.
Its these...
|
by: billr |
last post by:
I have developed a small API for taking care of a lot of boiler plate stuff
in a multi formed windows application, for example setting up a messaging
thread framework.
New Forms, in the appllication using the API, are subclassed to a Form
contained within the API, and they are controlled (controlled in this
instance means, kept alive, displayed and hidden) at runtime by a thread
whose responsibility is this sole task.
In order to run...
| |
by: Sky Sigal |
last post by:
I coming unglued... really need some help. 3 days chasing my tail all over
MSDN's documentation ...and I'm getting nowhere.
I have a problem with TypeConverters and
storage of expandableobjects to attributes in tags (think Style tag -> Style
object).
The problem that I am chasing is:
Html side:
|
by: Alan Silver |
last post by:
Hello,
This is NOT a troll, it's a genuine question. Please read right
through to see why.
I have been using Vusual Basic and Classic ASP for some years, and
have now started looking at ASP.NET. At first glance, it looks
excellent, albeit nothing that couldn't have been done to Classic ASP.
I have been through a few tutorials and was impressed with how quickly
you can get database info onto a page.
|
by: Jack Russell |
last post by:
I thought that I was a reasonable programmer but I am having some very
basic problems with .net
1) In vb3 to vb6 to use another form I said
frmColorTool.Show
What is the correct syntax in vb.net
2) how do I adress the controls in another form
|
by: Dave Booker |
last post by:
I have a Thread making a callback to a Form function that alters Form data.
Of course, the debugger is telling me, "Cross-thread operation not valid:
Control 'FormTest' accessed from a thread other than the thread it was
created on."
But I am locking before I touch the shared data, so do I actually need to
worry about this, or is it just the debugger being oversimplistic?
Specifically, I have:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |