public String[][] GetAllItems()
{
FoodCityData.ShoppingBuddyEntities fdContext = new FoodCityData.ShoppingBuddyEntities();
IQueryable<Item> Query =
from c in fdContext.Item
select c;
List<Item> AllfNames = Query.ToList();
int arrayZise = AllfNames.Count;
String[,] xx = new String[arrayZise,2];
int i = 0;
int j = 0;
foreach(Item x in AllfNames)
{
xx[i,0] = x.ItemName.ToString();
xx[i, 1] = x.ItemPrice.ToString();
i++;
}
return xx[2,2]; // how do i write return type?
}
Im在此代碼段返回類型中發現錯誤。我可以知道如何正確寫這種方法嗎?字符串數組類型方法返回類型錯誤
哪個錯誤?在這裏發帖 –
如果你不提供這個錯誤,你到底希望我們如何幫助你? –