Opinion on best data access method

G

Guest

My name is Glenn, I am an experienced VB5.0/6.0 programmer who is starting a
new project using VB.NET.

The project is simple but will be using a .mdb file for storing of data.
Only one person will be accessing the database at one time and the database
will be stored on a mapped shared folder.

I have been reading on ADO.NET and am getting a little confused and
wondering if I am am doing the right thing. The use of Data Adapters and
Data Sets just seems to be quite complicated for a small use of data access.

I am posting this to ask for an opinion on the best method to access this
database in this app. I am very happy to research the suggestions, I just
dont want to waste time researching something that wont suit/work.

If there are any further information you require please aks anything you can.

Thank you.

Glenn.
 
C

Cor Ligthert

Tippy,

I had when I started with it the same opinion as you, however AdoNet is
basicly very easy to use (In a multiuser environment it becomes more
complex, however that is as well with AdoDB in my opinion).

Have a look at the resource kit.

VB.net Resource kit
http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing the resource kit
http://msdn.microsoft.com/vbasic/vbrkit/faq/#installvdir

Newsgroups for VBNet and for AdoNet are

microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.framework.adonet

And please do not multipost, when you have a question where you do not know
where to place it crosspost it, that is no problem at all in dotNet
newsgroups. (Crossposting sending one message to more newsgroups).

I hope this helps?

Cor
 
J

Jon Skeet [C# MVP]

I have been reading on ADO.NET and am getting a little confused and
wondering if I am am doing the right thing. The use of Data Adapters and
Data Sets just seems to be quite complicated for a small use of data access.

One thing to bear in mind is that you don't have to use DataSets
themselves - they're just collections of DataTables. You can ignore
DataSets and go straight for DataTables to use with DataAdapters.
 
C

Cor Ligthert

Jon,
One thing to bear in mind is that you don't have to use DataSets
themselves - they're just collections of DataTables. You can ignore
DataSets and go straight for DataTables to use with DataAdapters.

I would not give that advice, using datatables gives problems when you want
to save it as a file, serialize it for web use and things like that.

I saw a lot of messages from people who takes that datatable approach and
become a little bit in trouble.

Of course is a datatable almost a disconnected lookalike from a recordset.

Just my 2 cents

Cor
 
J

Jon Skeet [C# MVP]

Cor Ligthert said:
I would not give that advice, using datatables gives problems when
you want to save it as a file, serialize it for web use and things
like that.

You can always put a DataTable into a DataSet if you need to, later on.

Furthermore, bear in mind that the OP specifically said it was for a
simple project - I very much doubt that it will incur any of the
problems above. When the problem's simple, I recommend using a simple
solution :)
I saw a lot of messages from people who takes that datatable approach
and become a little bit in trouble.

That doesn't necessarily mean that using DataTables was the problem, of
course...
 
C

Cor Ligthert

Jon,
You can always put a DataTable into a DataSet if you need to, later on.

No you cannot put a datatable into a dataset.

A dataset is an object that holds references to datatables. You can create a
new dataset and add references in the tableproperty from that too datatables
using the tables.add method

A dataset is not a container that holds values in a very classic way.
Furthermore, bear in mind that the OP specifically said it was for a
simple project - I very much doubt that it will incur any of the
problems above. When the problem's simple, I recommend using a simple
solution :)

Therefore I would not point on alternatives with Newbies, take the approach
as it is the most written on MSDN, and that is using the dataset.
That doesn't necessarily mean that using DataTables was the problem, of
course...

If you say so, can you give me an example what it could have been?

Cor
 
J

Jon Skeet [C# MVP]

Cor Ligthert said:
No you cannot put a datatable into a dataset.

Um, yes you can, in exactly the way that you then describe...
A dataset is an object that holds references to datatables. You can create a
new dataset and add references in the tableproperty from that too datatables
using the tables.add method

In what way is that not putting a DataTable into a DataSet? The result
is exactly the same as if you created the DataSet and populated it
automatically, then retrieved the DataTable.
A dataset is not a container that holds values in a very classic way.

It's a container in the same way that (say) an ArrayList is.
Therefore I would not point on alternatives with Newbies, take the approach
as it is the most written on MSDN, and that is using the dataset.

But that involves more complexity than just using DataTables.
If you say so, can you give me an example what it could have been?

If you could give me an example of the problem, certainly :)
 

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

Top