Pack small object and put them in an array

fasil

Member
Joined
Mar 27, 2005
Messages
15
Location
Denmark
Now here is my plan.

If I have made an succesful query returning me a dataset, or whatever we call (cross nationality).

I want to pack each of a table row data in an object representing the logical definition of the data table.

For example a query collecting data from a person table with all person attributes as FirstName, LastName, Address, Sex, Email etc.

I want to pack each of the person in an Person object, which I want to store in an array which I want to return as the last thing.

Now in my presentation layer I want to unpack this array and present the data. Does anyone have a example of that.

I have tried coding a cart example which does not work. I am missing something, which I hope someobne in here can help me with.

#My code with a shopping cart example.#

using System;
using System.Collections;
using MySql;
using MySql.Data;
using MySql.Data.MySqlClient;

public class CartData
{
private int _ProductId;
private int _PhotoId;
private int _CatPhotoId;
private int _SupplierId;
private string _CartGuId;
private string _ProductName;
private string _ProductDescription;
private decimal _ProductPrice;
private int _Amount;

//Properties

public CartData()
{
}

public int ProductId
{
get { return _ProductId;}
set { _ProductId = value;}
}
public int PhotoId
{
get { return _PhotoId;}
set { _PhotoId = value;}
}
public int CatPhotoId
{
get { return _CatPhotoId;}
set { _CatPhotoId = value;}
}
public int SupplierId
{
get { return _SupplierId;}
set { _SupplierId = value;}
}
public string CartGuId
{
get { return _CartGuId;}
set { _CartGuId = value;}
}
public string ProductName
{
get { return _ProductName;}
set { _ProductName = value;}
}
public string ProductDescription
{
get { return _ProductDescription;}
set { _ProductDescription = value;}
}
public decimal ProductPrice
{
get { return _ProductPrice;}
set { _ProductPrice = value;}
}
public int Amount
{
get { return _Amount;}
set { _Amount = value;}
}

}

/// <summary>
/// Summary description for CartContent.
/// </summary>
public class CartContent
{
string guid;

public CartContent()///Constructor
{
//L
 
Back
Top