I have a company table and i used query select * from company
.But now i only require all the company name from this table , how toget and store in to a string array.Following code snippet only one i raw of company name i get. but how to get all company names and store in to an array
reader = cmd.ExecuteReader();
// write each record
while(reader.Read())
{
Console.WriteLine("{0}",
reader["CompanyName"];
}