public static void Main()
DataTable table = GetTable();
Program pr = new Program();
pr.CheckIfExistsInTable("Foxie");
foreach (DataRow row in table.Rows)
Console.WriteLine("Index " + table.Rows.IndexOf(row) + " Contains Member from the table " + row["Name"] + " Their Tier is " + row["Tier"] + " and their Name colour is " + row["NameColour"]);
static DataTable GetTable()
DataTable GangGangtable = new DataTable();
GangGangtable.Columns.Add("Name", typeof(String));
GangGangtable.Columns.Add("Tier", typeof(string));
GangGangtable.Columns.Add("NameColour", typeof(string));
GangGangtable.Rows.Add("Dj", "OG", "Blue");
GangGangtable.Rows.Add("Foxxie", "Newbie", "Pink");
GangGangtable.Rows.Add("Amare", "OG", "Pink");
GangGangtable.Rows.Add("Lady", "OG", "Pink");
GangGangtable.Rows.Add("Rookie", "OG", "Yellow");
public void CheckIfExistsInTable(String Name)
Console.WriteLine(Name + " Exists in the datatable");
else if (Name == "Foxxie")
Console.WriteLine(Name + " Exists in the datatable");
else if (Name == "Amare")
Console.WriteLine(Name + " Exists in the datatable");
Console.WriteLine(Name + " Exists in the datatable");
Console.WriteLine(Name + " does not exist");