Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB2005 and Ado.Net, i'm lost.

Status
Not open for further replies.

rssql

Programmer
Jul 22, 2002
87
US
My 20+ years experience is primarily VB6 and MS Access and working with various backends and devices.

In VB2005 i have started a project.
On the left i see "Database Explorer", and on the right is "Data Connections".

Questions:
Do I always have to use one or both of those things?

I just wanna have a connection ready to use at all times to my database.

I'm not real sure about why I would want to use a DataSet.
I'm thinking that I want to read or write to the real tables.

So a DataReader is only good for read-only?



Many of the aricles/books I read talk about the different "Core Objects" in ADO.NET.
It's like openning a toolbox in an extraterestrial spaceship's garage.
Can't figure out what the hell to do with some of these new-fangled widgets.

All this "ADO.NET is more better" kind of talk is very confusing.
It's obviously (to me) not any easier or simpler.
It's not making my life better.

Maybe I'm just not drinking the right kool-aid.




-------------------
The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge.
Daniel Boorstin
 
It's all very simple actually. You have to see a dataset/datatable as a disconnected recordset from the data in your table. So you get them from the table and that's it and as long as you don't refresh the dataset the two will not be matched.

Working with ADO.Net you have two options and that is use the datareader to fill your objects/dataset/datatable and then use the commandobject to make insert/Update/delete-statements or you could use the dataadapter. The dataadapter can fill/insert/update/delete data out of your datasource (not only databases) For this it uses the different commands like selectcommand, insertcommand, ... It is up to you to write these commands or let the commandbuilder do it for you.

So you have different options but none of them very good. If you practice the OO programming techniques you will most likely want to make things more simple and use an ORM like nHibernate or the likes.

Hope this helps. Please ask more questions if you still have problems.

Christiaan Baes
Belgium

"My old site" - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top