Data Access

M

Miro

I am reading a VB.Net 2003 book and it has a Question and Answer section.

Is this statement still "True" with 2005 ?

Q:
I know all about the disconnected database architecture in ADO.NET, but my
database is in frequent use by other users, and I really want to make sure
I'm using the most recent data. Is there really no way to maintain a
continuous connection to a database in Visual Basic .Net ?

A:
Actually, thre is. If you really need a continuous connectino to a
database, you can use traditional ADO ( instead of ADO.NET ) objects. To
work with these objects, you select the Project, Add Reference menu item,
click the COM tab in the Add Reference dialog, and select one of the ADO
libraries. Then you can use ADO objects in your code.

( page 722 - SAMS Teach Yourself Microsoft VIsual Basic.Net 2003 in 21
days )

Miro
 
G

Guest

Is this statement still "True" with 2005 ?

Yes, but I wouldn't use ADO... it's pretty much legacy.
Q:
I know all about the disconnected database architecture in ADO.NET,
but my database is in frequent use by other users, and I really want
to make sure I'm using the most recent data. Is there really no way
to maintain a continuous connection to a database in Visual Basic .Net
?

A:
Actually, thre is. If you really need a continuous connectino to a
database, you can use traditional ADO ( instead of ADO.NET ) objects.
To work with these objects, you select the Project, Add Reference menu
item, click the COM tab in the Add Reference dialog, and select one of
the ADO libraries. Then you can use ADO objects in your code.

A couple solutions:

1. Write some sort of concurrency control (lock the record?)
2. Use a data access layer framework which provides this sort of control...
like LLBLGen Pro.
 
M

Miro

Thank you,

It just struck me that a book was giving an example to use the .COM when
everyone says try not too.

M.
 
W

William \(Bill\) Vaughn

It's misguided. You should not be using ADO (com-based) in a .NET
application if you can help it. In my new book I talk about how to create
and hold an ADO.NET connection as well as how to create a server-side
cursor--which is the only advantage to using ADO classic.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
M

Miro

That was the only example of the .COM,

all examples given use the .Net, and I'm trying to stay clear of the .COM as
much as possible :)

I did check out your website and looked at ur book. Once I get more into VB
and learn how to use a couple
more components I might need an ADO book. :)

I did have to use ADOX to create an access table with indexes and keys (
thru code ). Does ur book have that too?

Thanks

Miro
 
W

William \(Bill\) Vaughn

I've never felt the need to document ADOX--there are so many other
alternatives when it comes to SQL Server. ADOX was only created to
supplement JET functionality.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

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