DataSource drugInfo= new DataSource(); DataTable productTable = new DataTable("Product_Name"); DataColumn productCol = new DataColumn("Product"); productTable.Columns.Add(productCol); DataRow productRow = productTable.NewRow(); productRow[productCol] = product.PrimaryPreferredName; productTable.Rows.Add(productRow); drugInfo.Tables.Add(productTable); //End of product info //INGREDIENTS INFO DataTable ingrdnts = new DataTable("Ingredients"); DataColumn drugIngrdnts = new DataColumn("INGREDIENTS"); ingrdnts.Columns.Add(drugIngrdnts); Ingredient[] drugIngrdnt = product.GetIngredients(); foreach (Ingredient ingrdnt in drugIngrdnt) { DataRow ingName = ingrdnts.NewRow(); ingName[i] = ingrdnt.Text; ingrdnts.Rows.Add(ingName); i++; } drugInfo.Tables.Add(ingrdnts);
GridView2.DataSource= drugInfo.Tables[0].DefaultView;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)