Thursday, March 22, 2012

me.confused!

Hi all,

I am really confused now.. ASP.NET has too many new features that, I'm all confused with. so we've got dataAdapter, datasets, datagrids, datalists and datasets. what are they really doing and what is the distinctive differences between them. most importantly when to use which one.

retreiving data from the db and displaying it is usually an easy task. I know that its even easier in ASP.NET but when you have all these controls and properties and methods, I really don't know when to use which one according to what scenario. i find examples with datagrid then i found some other examples with datagrid and dataset used together, then I found another example which used dataadapter, dataset and datagrid.? ***! !! ?? whats going on ?

For example, I heard that datasets are great way of storing data in memory thereby saving the heavy task of opening the db each time. but on the other hand, i also heard using datasets may also put great pressure to the memory.

Can someone please explain what all those things do and if possible provide links that teaches the theories behind them and how they actually work (not code examples)

Thanks,Yes, the variety is staggering. And the way to use the tools is too.

A DataGrid is used mainly to display and interface with the data. In essence it will create the HTML <table>, but obviously has much more control on the code side.

DataTables, DataLists, and DataSets are different types of containers for holding data. They all have unique features. A DataSet for instance can contain a collection of DataTables.

The DataAdapter is a method to get data from a connected source( database) and put it in one of the containers.

We can bind data to a datagrid, separating the data from it's display.

I know that don't help a whole lot but try:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconpopulatingdatasetfromdataadapter.asp

I suggest finding some examples and start playing with them.
Thank you for the reply. I hope more people will contribute to this thread.

the thing with the examples; I actually started coding a while ago and as I get a little better, I tend to think.. "hmm.. what should I use for this part" if you know what i mean..

I'll check out the link you provided now..

thanks...

any more ideas people ??
> what are they really doing and what is the distinctive differences between them.

You may be interested in reading:
Understanding the Differences Among the DataGrid, DataList, and Repeater
DataGrids, DataSets, and XML Strings
XML, the DataSet, and a DataGrid

> am really confused now.. ASP.NET has too many new features

When I was in highschool, my English teacher introduced Macbeth. He said, "You may have a hard time following some of Shakespeare. Don't worry about it. Just try to get the gist of it, and move on."

I think this applies well to ASP.NET.

The richness of .NET means that it is very very easy to get confused. There are so many classes and so many ideas that you cannot hope to understand everything.

Don't get bogged down in any one area. Just try to get the gist of each concept, and move on.
Inevitably you'll revisit some areas, and each time you will understand the area a little better.

I hope this helps.

0 comments:

Post a Comment