Online Movies
http://onlinemovies123.blogspot.com/
http://www.telugunagar.com/
http://www.indiaglitz.com/channels/telugu/
http://heatkeys.com/microsoftechies.wordpress.com
Using custom collections with the ASP.NET DataGrid control
Collection Asp.Net
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
namespace Test_S.Class
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
GenericCollection Customers = new GenericCollection();
GenericCollection Employess = new GenericCollection();
Customers.Add(new Customer(“GM”, “SH000100”));
Customers.Add(new Customer(“P & G”, “SH000110”));
Customers.Add(new Customer(“Solectron – Belgium”, “SH000120”));
Employess.Add(new Employee(“Mahesh”, “20049986”, 28));
Employess.Add(new Employee(“Aravind”, “20059986”, 32));
Response.Write(“Customers”);
Response.Write(“
“);
Response.Write(“=========”);
Response.Write(“
“);
foreach (Customer cust in Customers)
{
Response.Write(cust.ToString());
Response.Write(“
“);
}
Response.Write(“
“);
Response.Write(“Employees”);
Response.Write(“
“);
Response.Write(“=========”);
Response.Write(“
“);
foreach (Employee emp in Employess)
{
Response.Write(emp.ToString());
Response.Write(“
“);
}
//System.Console.ReadLine();
}
}
class GenericCollection
: CollectionBase
{
public void Add(GenericType GenericObject)
{
InnerList.Add(GenericObject);
}
public void Remove(int index)
{
InnerList.RemoveAt(index);
}
public GenericType Item(int index)
{
return (GenericType)InnerList[index];
}
}//end of GenericCollection
class Customer
{
private string strCustomerName;
private string strCustomerShipTo;
public Customer(string CustomerName, string ShipTo)
{
strCustomerName = CustomerName;
strCustomerShipTo = ShipTo;
}
public new string ToString()
{
return (“Name : ” + strCustomerName + “\n” +
“Ship To : ” + strCustomerShipTo);
}
} //end of Customer
class Employee
{
private string strEmployeeName;
private string strEmployeeID;
private Int32 intEmployeeAge;
public Employee(string EmployeeName, string EmployeeID, Int32 Age)
{
strEmployeeName = EmployeeName;
strEmployeeID = EmployeeID;
intEmployeeAge = Age;
}
public new string ToString()
{
return (“Name : ” + strEmployeeName + “\n” +
“ID : ” + strEmployeeID + “\n” +
“Age : ” + intEmployeeAge.ToString());
}
} //end of Employee
}