Class VS Components

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In ASP.NET if am writing a class for Datalayer ,

Public Class XXX{
// I am createing a class file and write all database activity methods there
}


OR

public class XXX : System.ComponentModel.Component{

// I am Creating a component and write all all database activity methods there
}

What is the difference?
The only difference i find is in the second case class inherits some class. and i can drag and drop data controls,
which otherwise in the first case i have to write manually.

Can someone guide me the technical difference and which approach i should take.


Regards,
 
The following article should be helpful:

http://msdn.microsoft.com/library/d...guide/html/cpconclassvscomponentvscontrol.asp

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

<Jignesh> wrote in message
In ASP.NET if am writing a class for Datalayer ,

Public Class XXX{
// I am createing a class file and write all database activity
methods there
}


OR

public class XXX : System.ComponentModel.Component{

// I am Creating a component and write all all database activity methods
there
}

What is the difference?
The only difference i find is in the second case class inherits some class.
and i can drag and drop data controls,
which otherwise in the first case i have to write manually.

Can someone guide me the technical difference and which approach i should
take.


Regards,
 
Thanks for the link but i could not make a decision.

Actually i have seen people developing web application using "Add componets"
menu for DAL(Data Access Layer). I just wanted to know is that right

bcos as such the only diff between the two is that the other just inherits
System.ComponentModel.Component

and its allows me to drag and drop data controls like (ds, adaptor etc)
 
It isn't a matter of which one is "better." It's a matter of which one is
the appropriate tool for your particular job. The article tells you when to
use one and when to use the other.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top