Saturday, 12 January 2013 14:54

List in

Written by 
Rate this item
(0 votes)

List<> can be used as a collection of objects which
can be accessed by index.List originated from
System.Collections.Generic class.List objects can
be sorted,searched, List is very
useful in programming for holding any type of
objects.following shows a example of List<> -

first create a variable of List<> type

List<String> Res = new List<String>();

following way string objects are added to the List -

SqlConnection Conn = new SqlConnection(ConnectionString);
SqlCommand Cmd = new SqlCommand("SELECT CName FROM Categories", Conn);

SqlDataReader Categories = Cmd.ExecuteReader();

while (Categories.Read())

Read 3008 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest discussions

  • No posts to display.