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

Building Dataset from Class Array

Forgive any bad terms. New to .Net development

My business layer has something similiar to this

class Accoun
private m_Notes as Note(

' Get Mehod
..
end clas

Class Not
private m_strText as Strin
private m_dCreateDate as Dat

' Get Method
..
' Load Function
..
End Clas

My question is this. Obviously I have a array of Notes objects within my Account object. From prior ASP.NET experience I know I want to have a DataSet of Notes for the Presentation layer. Is there a standard way to produce or store the dataset

It doesn't make too much sense to me to have a Member Function in Accounts that builds a Dataset from the Notes array but am not sure of alternatives

I apologize for the double post (one in the public forums) I am new to the Managed Groups

TIA
- Marc Castrechini
Nov 18 '05 #1
4 1602
Hi Marc,

Thanks for posting in the community!
From your description, you're looking for some suggestions on generate
DataSet(DataTable and recoreds) from existing Class Instances. Also, these
classes has relations with each other such as Master-Detail.. ,yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my experience, if you used untyped dataset, you may need to create
the dataset and DataTables and manually create datarow and set the datas
in your class instance into row. However, the typed DataSet maybe more
suitable for you, it can provide more object-oriented operations on
manipulating data(insert , update ,delete). Do data manipulate on typed
dataset is just like on a certain class's instance collection. Here are
some tech references and articles on typed dataset:

#Walkthrough: Creating a Dataset with Tables, Keys, and One-to-Many
Relationships
http://msdn.microsoft.com/library/en...roughCreatingX
MLSchemaWithOne-to-ManyRelationship.asp?frame=true

#Creating Typed Dataset
http://msdn.microsoft.com/library/en...DataSetCreatio
nInVisualStudioNET.asp?frame=true

#Working with a Typed DataSet
http://msdn.microsoft.com/library/en...ingwithtypedda
taset.asp?frame=true

#Implementing Data Transfer Object in .NET with a Typed DataSet
http://msdn.microsoft.com/library/en...typedDataSet.a
sp?frame=true

Please check out the above items. Hope they are helpful.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
Hi Marc,

Have you had a chance to check out my suggestions or have you got any new
ideas on this issue? If you have any
further questions , please feel free to post here.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3
Found it.

If anyone is curious:

This is pretty easily done by creating a collection using CollectionBase as
seen here:
http://msdn.microsoft.com/library/de...classtopic.asp

Then using standard data binding with the collection.

- Marc

"Marc Castrechini" <mc@merchantWarehouseREMOVETHIS.com> wrote in message
news:C9**********************************@microsof t.com...
Forgive any bad terms. New to .Net development.

My business layer has something similiar to this:

class Account
private m_Notes as Note()

' Get Mehods
...
end class

Class Note
private m_strText as String
private m_dCreateDate as Date

' Get Methods
...
' Load Functions
...
End Class

My question is this. Obviously I have a array of Notes objects within my Account object. From prior ASP.NET experience I know I want to have a
DataSet of Notes for the Presentation layer. Is there a standard way to
produce or store the dataset?
It doesn't make too much sense to me to have a Member Function in Accounts that builds a Dataset from the Notes array but am not sure of alternatives.
I apologize for the double post (one in the public forums) I am new to the Managed Groups.
TIA,
- Marc Castrechini

Nov 18 '05 #4
Hi Marc,

Thanks for your response and I'm glad that you've found the good solution.
Also thanks a lot for sharing your solution with us. Anyway, if you need
any help next time, please always feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #5

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

Similar topics

10
by: James D. Marshall | last post by:
Help, went brain dead here, need to build a multi dem array from a csv txt file, just point to a good article and I am sure the old gray matter will do a doh!.
2
by: Marty McDonald | last post by:
I have an array of objects (my own custom class). I'm trying to convert that array to a dataset. So I serialize the array to XML, then try to load the XML to a dataset. MemoryStream mem = new...
6
by: Boaz Ben-Porat | last post by:
I heard somewhere that the DataGrid class is implemented as a XML graph in memory. Is this true ? TIA Boaz Ben-Porat DataPharm a/s Denmark
5
by: Trond | last post by:
I have a webservice that is returning a dataset. In dataset there is a table with 4 columns. (LDate, LTime, LDepth and ServiceNumber) I then try to read only 2 of the columns into array (double...
0
by: Curt Emich | last post by:
I have another question about this process of getting a connection set up and then populating a drop-down list box with a query. I was able to create a connection like you said, and then I...
0
by: Marc Castrechini | last post by:
Forgive any bad terms. New to .Net development My business layer has something similiar to this class Accoun private m_Notes as Note( ' Get Mehod .. end clas
6
by: Dennis | last post by:
I was trying to determine the fastest way to build a byte array from components where the size of the individual components varied depending on the user's input. I tried three classes I built: (1)...
4
by: Nikolay Petrov | last post by:
I am searching for an idea how to optimize some of my code. Let's say I have a class, which exposes some properties: Class Dummy1 Private m_sValue1 As String Private m_sValue2 As String...
4
by: LW | last post by:
Hi! I have a DataSet and a class in my Web Service. My output for example is: <OrderInfo> <CustomerID>VINET</CustomerID> <OrderID>10248</OrderID> <OrderDate>07/07/1996</OrderDate>...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.