Overall problems with Databases (connection) in .net

e.brinkman

New member
Joined
Jun 26, 2006
Messages
1
Programming Experience
Beginner
hi,

im a beginning programmer in vb6 and i want to make the step to .net. At my job i have made a couple of apps where i needed connections to databases. This wasn't any problem. I not only needed the connection i had to update also. So i am formiliair with recordsets etc. Now i want to make the step to .net.
I know how to make a connection, there is a wizard to do that. I also made a connection trough code. So thats not the problem. In VB6 i could Use Recordset. And in .NEt u have dataset, datatable, oledbcommand etc etc. Can anyone tell me how to make a normal connection with a database. Not only a connection, but also i need to update, edit, delete etc. Which of the things named above do i need to get the same results as i did with the recordset within vb6.

Also i want to display an Image in a ImgEdit1 box (KODAK). It are TIFF images so the picturebox doesnt work. The Images are in multiple directories. In the database there is a field where al the directories are in.

So to make a long story short, I want to display an Image from a Path-field in an Access 2003 database.

I know, for some of you die-hard .net programmers this is a piece of cake. I hope someone can help me, so i can be a die-hard programmer in a few yrs too.


And if you need more info regarding my probs, just email me.

greetingz,,
Emiel Brinkman
Netherlands.
 
Developing apps in VB.net

Hi,

There are differences between vb6 and .Net. You should basically cocentrate on disconnected architecture for accessing the data and updating the data through dataadapters.

Developing Client/Server apps are very easy. Split the classes based on the standard tiers.

Refer good books and tutorials.

Regards
bhar
knowledge is power
http://www.vkinfotek.com
 
While I believe noone would type a full response regarding ADO.NET and the way it works compared to ADO 2.x I can give you a small brief.

The connection objects while strongly updated with more methods and properties remain very similar to the old way. You setup your connection string and open your connection.

A command object is used to execute commands to the server. After you do so you can either do:
  • ExecuteScalar : Will just return a single value, useful for COUNT statements.
  • ExecuteReader : Outputs a dataReader object which is read and forward only. dataReader is very fast and is greatly appreciated when you do not have to update records on your database, focus with a dataReader when you just fetch data.
  • ExecuteNonQuery : Returns no results of any type. Useful for anything that you do not expect anything back from the server.
Use a DataAdapter that plugs in to command object (binds to SelectCommand property) to retrieve (fill) a dataTable or a dataSet.

dataSet is a collection of dataTables with various properties and methods as well.

The power of ADO.NET with the dataSets or dataTables is that they are in-memory which means that after you generate them, you can close the connection after and work with your data. After you are done you can then submit your changes based on the InsertCommand or UpdateCommand - or DeleteCommand of your dataAdapter object.

There are books for all these objects. You can go deeper to the structure of a dataTable that consists of dataColumns and dataRows and then you can setup DataRelations between two dataTables, etc etc. (already confused? ;) )

Hope this helps for starters ;)
 
And don't forget about the TableAdapters new to ADO.NET 2.0.

Here's a link to some videos Miscrosoft supplies:
Video Training at MSDN
Follow the links under the 'Video training for intermediate Web developers' section and look for the data access videos.
 
Back
Top