473,320 Members | 1,817 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,320 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 1600
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.