473,383 Members | 1,818 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,383 software developers and data experts.

exposing datasets

hey all,

is it ok to make a dataset public property? ok to make a dataset a public
variable? which one is better, if any? why?

thanks,
rodchar
Nov 21 '05 #1
8 1044
Rodchar,

Depends how you use it, however in the way I understand now from you will it
more often be something as an own inherited dataset class itself. And than a
start for a typed dataset.

\\\
Class MyDataset
Inherits Dataset
////

However tell something more.

Cor
Nov 21 '05 #2
i'm using it in a single business class where i instantiate it and expose it
as a public property from that class.

"Cor Ligthert" wrote:
Rodchar,

Depends how you use it, however in the way I understand now from you will it
more often be something as an own inherited dataset class itself. And than a
start for a typed dataset.

\\\
Class MyDataset
Inherits Dataset
////

However tell something more.

Cor

Nov 21 '05 #3
Rodchar,

When it is in a class there is no reason to use a property.

However, until now do I use it for ever. I asked often in this newsgroup"Can
anybody give me a reason". I never have seen a *rational* reason for that.

Cor
Nov 21 '05 #4
So what if another class needs the dataset, should I just make the dataset a
public variable instead of property?

"Cor Ligthert" wrote:
Rodchar,

When it is in a class there is no reason to use a property.

However, until now do I use it for ever. I asked often in this newsgroup"Can
anybody give me a reason". I never have seen a *rational* reason for that.

Cor

Nov 21 '05 #5
Rodchar,

I hope you become not agry however it sounds so strange for me.

A datatable is a class that describes a kind of entity and has methods and
events for that (it reflects a database table). A dataset describes even a
collection of datatables and can reflects a complete database..

Now becomes dataset a property of a class. And therefore I become confused.

Can you show some code of that class.

Cor
Nov 21 '05 #6
Public Class Customer
Dim oDataAccessLayer As DataAccessLayer
Dim _ds As dsNorthwind
Dim _dr As dsNorthwind.CustomersRow

Public Sub New()
oDataAccessLayer = New DataAccessLayer
_ds = New dsNorthwind
End Sub

Public Property oDsNorthwind()
Get
Return _ds
End Get
Set(ByVal Value)
_ds = Value
End Set
End Property

Public ReadOnly Property CustomerID() As String
Get
Return _dr.CustomerID
End Get
End Property
Public Property CompanyName() As String
Get
Return _dr.CompanyName()
End Get
Set(ByVal Value As String)
_dr.CompanyName = Value
End Set
End Property

Public Property ContactName() As String
Get
Return _dr.ContactName
End Get
Set(ByVal Value As String)
_dr.ContactName = Value
End Set
End Property

'Retrieve all customers
Public Function RtvAllCustomers() As dsNorthwind
oDataAccessLayer.RetrieveAllCustomers(_ds)
Return _ds
End Function

'Create single customer
Public Sub RtvCustomer(ByVal ID As String)
_dr = _ds.Customers.NewCustomersRow
oDataAccessLayer.RetrieveCustomer(ID, _dr)
End Sub
'Retrieve single customer
'Update single customer
'Delete single customer
End Class

The dataset contains the orders table as well.

"Cor Ligthert" wrote:
Rodchar,

I hope you become not agry however it sounds so strange for me.

A datatable is a class that describes a kind of entity and has methods and
events for that (it reflects a database table). A dataset describes even a
collection of datatables and can reflects a complete database..

Now becomes dataset a property of a class. And therefore I become confused.

Can you show some code of that class.

Cor

Nov 21 '05 #7
Rodchar,

Is dsNorthwind a strongly typed dataset?
(Made with the designer)

Cor
Nov 21 '05 #8
yes.

"Cor Ligthert" wrote:
Rodchar,

Is dsNorthwind a strongly typed dataset?
(Made with the designer)

Cor

Nov 21 '05 #9

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

Similar topics

4
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
3
by: Dave | last post by:
Please - anyone that can help. I am getting confusing results while trying to expose a collection from a web service. I have a webservice in which a web method accepts a collection as a...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
16
by: Luqman | last post by:
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ? Best Regards, Luqman
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
25
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as...
2
by: S.Tedeschi | last post by:
Hi all gurus. I'm trying to switch to VS 2005, from VS 2003. I've an ASP.NET 1.1 app heavily relying on StronglyTyped DataSets, with lots of FindByKey..., dataSet.Tablename, and similar methods....
0
by: S.Tedeschi | last post by:
Hi all; as posted some days ago, I'm converting an on-line app; I used to heavily rely on strongly-typed DataSets directly dropped onto pages, and so viewed by code(-behind) as well. In the next...
12
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
9
by: gardnern | last post by:
We have X number of data sets, of Y length each. For example... Small, Medium, Large and Red, Green, Blue, Yellow We need to generate a list of all possibilities Small Red
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.