Do we really need ASP.NET's xyzDataSource controls?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edurazee
    New Member
    • Dec 2009
    • 13

    Do we really need ASP.NET's xyzDataSource controls?

    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:

    Code:
    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?
  • sanjib65
    New Member
    • Nov 2009
    • 102

    #2
    First of all, you can have a look at this very useful link:



    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?

    Comment

    • edurazee
      New Member
      • Dec 2009
      • 13

      #3
      Originally posted by sanjib65
      First of all, you can have a look at this very useful link:



      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?
      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.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        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

        Comment

        Working...