473,395 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Class to use VB6-style access of VB.Net data objects

Greetings!

It seems to me that .Net is much more typing-intensive than VB6 was.
Instead of getting a recordset and reading a value from it using something
like "Name = MyRecordset("name")", I have to say something like "Name =
MyDataset.Tables(0).Rows(0)("Name")". I am tempted to write a class that
would inherit from DataSet and would provide the same interface that the VB6
RecordSet object did. It would have to have MoveFirst, MoveNext, EOF, and
BOF methods and such like.

Before I try to build something like this, I'm curious: Has anyone else
already done this?

Thanks very much!

Rob
Nov 20 '05 #1
2 1112
The DataReader functions in more or less that manner.
Every time you call Read( ) on the DataReader, it advances one row, like
MoveNext in the old ADO classes, and you can get a value from the current
row just by specifying the name or position as in your example. However,
note that the DataReader is forward-only read-only.

-Rob Teixeira [MVP]

"Rob Richardson" <th*****@n2net.net> wrote in message
news:10*************@corp.supernews.com...
Greetings!

It seems to me that .Net is much more typing-intensive than VB6 was.
Instead of getting a recordset and reading a value from it using something
like "Name = MyRecordset("name")", I have to say something like "Name =
MyDataset.Tables(0).Rows(0)("Name")". I am tempted to write a class that
would inherit from DataSet and would provide the same interface that the VB6 RecordSet object did. It would have to have MoveFirst, MoveNext, EOF, and
BOF methods and such like.

Before I try to build something like this, I'm curious: Has anyone else
already done this?

Thanks very much!

Rob

Nov 20 '05 #2
Rob,
Before I try to build something like this, I'm curious: Has anyone else
already done this? Yep! Microsoft did!

Look up "Typed DataSets" in the online help:

Some links from a quick MSDN search that look promising.

http://msdn.microsoft.com/library/de...etdatasets.asp

http://msdn.microsoft.com/library/de...lstudionet.asp

http://msdn.microsoft.com/library/de...tml/vb03f9.asp

http://msdn.microsoft.com/library/de...peddataset.asp

In case you don't have it, you may want to pick up David Sceppa's book
"Microsoft ADO.NET - Core Reference" from MS Press. It is a good tutorial on
ADO.NET, plus a good desk reference once you know ADO.NET. Also David's book
gives some insight on how the Typed Datasets work...

Hope this helps
Jay

"Rob Richardson" <th*****@n2net.net> wrote in message
news:10*************@corp.supernews.com... Greetings!

It seems to me that .Net is much more typing-intensive than VB6 was.
Instead of getting a recordset and reading a value from it using something
like "Name = MyRecordset("name")", I have to say something like "Name =
MyDataset.Tables(0).Rows(0)("Name")". I am tempted to write a class that
would inherit from DataSet and would provide the same interface that the VB6 RecordSet object did. It would have to have MoveFirst, MoveNext, EOF, and
BOF methods and such like.

Before I try to build something like this, I'm curious: Has anyone else
already done this?

Thanks very much!

Rob

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Neil Stevens | last post by:
Hi, I have been tasked to upgrade a project from VB6 to VB.NET, i have a number of problems of which most i have now solved but i am still very perplexed by one problem. The VB6 application has...
6
by: Nick Dreyer | last post by:
In VB.NET I would like to not have to create property get/set procedures for every class variable I want to expose to Excel VBA projects in COM builds. Can anyone tell me if that is possible, or...
0
by: Dmitri Shvetsov | last post by:
Hi, Did anybody can use the C# class library from VB6 ? I tried a standard COM+ wrapper with a C# class library, but it doesn't work, I have no idea why. My class library consists from a few...
2
by: CYShao | last post by:
My company have many release programs written VB6.0 before. Now, we want to add new functionalities in C#, and relpece old VB6 programs step by step. Obviously, COM is a good way to do that. In...
1
by: Nijazi Halimaji | last post by:
Hi everybody I have created a .NET Library (Build it) and implemented it in VB6. In VB6 i used a reference to get the functions, etc. and it worked fine. But when I make a setup project in VB6...
0
by: simonrobshaw | last post by:
Hi, I need some help in making a design choice for a project which we are currently working on. My client has a VB6 application which we don't see them actually changing in the near future. ...
1
by: simonrobshaw | last post by:
Hi, I need some help in making a design choice for a project which we are currently working on. My client has a VB6 application which we don't see them actually changing in the near future. ...
2
by: Matt Brown - identify | last post by:
Hello, I decided to not spend the rest of my life figuring out docking and, instead, use the cDockingHandler class offered on Veign.com (http:// www.veign.com/vrc_codeview.asp?type=app&id=149)....
5
by: Joseph Geretz | last post by:
Of course, I can store a C# class instance to the Server Cache (this.Context.Cache). I've tried it. My question is, will this destroy the scalability of my application? My background is VB6....
5
by: Christiano Donke | last post by:
Plz.. I intend to share a class library though network. This library is gonna be called by a VB6 project. I've found out that a late file-based binding on vb6 is the easiest way to bind it......
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.