Class VS Components

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,
 
K

Kevin Spencer

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,
 
J

Jignesh

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)
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top