/// <summary> /// Ilir Method /// </summary> /// public DataTable GetTableWithInitialData(RecipeIngredientModel item1, IngredientModel item2, string RecipeID) // this might be your sp for select { DataTable table = new DataTable(); table.Columns.Add("Ingredient", typeof(string)); table.Columns.Add("Unit", typeof(string)); table.Columns.Add("Quantity", typeof(string)); List <recipeingredient> combine = new List <recipeingredient>(); combine = item1.getIngredientDetailByRecipeID(Convert.ToInt32(RecipeID)); foreach (var x in combine) { // lblData1.Text += string.Format("<strong>Name: {0}</strong> </br> Quantity: {1} </br> Unit of Measure: {2}</br></br>", item2.getIngredientByID(x.Ingredient), x.Quantity, x.UM); table.Rows.Add(item2.getIngredientByID(x.Ingredient), x.UM, x.Quantity.ToString()); } //table.Rows.Add("Carrot", "KG", "1.5"); return(table); }