Thanx.. I'm new in C# so may be i miss some logic..
I'm using v1.1 what is CollectionBase??
I'm just try creat Data access Tier, but i don't have enought info about
this. would u help me to find good resource in how to develop my application
in 3 tier instead of but my code in the codebehind of my webform??
"Nathan Neitzke" <ne******@erau.edu> wrote in message
news:ue**************@TK2MSFTNGP09.phx.gbl...
I am not going to go into this - but why do you have a collection
inheriting from the object it is a collection of? This is a poor design.
Rather, it should inherit from CollectionBase (if .NET <= v1.1) or (use
generics .NET= 2.0).
Secondly, I would do the following -
Create an ArrayList and for each Appointment, just go ArrayList.add(new
Appointment() );
Then, return the ArrayList.ToArray() result.
Let me know if this works.
Take care.
--
Nathan
Or
"Islam Elkhayat" <Is******@Free-mail-Domains.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl... here is my class
public class AppointmentRowCollection : Appointment
{
public Appointment[] GetRowsCollection(out int rows)
{
int i = 0;
dataset= new AppointmentDS();
dataset= SelectAppointment();
DataRowCollection drcollection = dataset.Appointments.Rows;
rows = drcollection.Count;
foreach (DataRow row in drcollection)
{
AppointmentID = int.Parse(row["AppointmentID"].ToString());
AppointmentDate= Convert.ToDateTime(row["AppointmentDate"]);
TimeFrom= row["TimeFrom"].ToString();
TimeTo= row["TimeTo"].ToString();
return new Appointment();
}
return null;
}
}
AppointmentID,AppAppointmentDate....... is a public property From
Appointment Class
How ca i return Appointment[] array form my foreach loop??