Task03Entities.Entites entities = new Task03Entities.Entites();
// Creat a object for my entites class
Task03BAL.BAL bal = new Task03BAL.BAL();
// creat a object of BAL to call Get Data Method
List<Task03Entities.Entites> entitiesList = new List<Task03Entities.Entites>();
// make a list of class Entities
entitiesList = bal.GetData(entities);
// store data in list
ViewState.Add("Products", entitiesList.ToArray());
// use view state to store entitieslist
Task03Entities.Entites[] entitiesArray =(Task03Entities.Entites[])ViewState["Products"];
List<Task03Entities.Entites> ViewStateList =new List<Task03Entities.Entites(entitiesArray);
// so now ViewStateList contain entitieslist data
// Now the Problem which i am facing is
if (Request.QueryString["count"] != null) // this is okay
{
listCount =Convert.ToInt32(Request.QueryString["count"]);
}
for (int i = (listCount * 2)-2; i < listCount * 2; i++)
{
Task03Entities.Entites newViewStateList = new Task03Entities.Entites();
newViewStateList = ViewStateList[i];
// view state contain a list of data here on above line m trying to acess single data
%>
<table>
<%
foreach (Task03Entities.Entites item in newViewStateList)
// on above line i am getting following error message
コンパイラ エラー メッセージ: CS1579: 'Task03Entities.Entites' には 'GetEnumerator' のパブリック定義が含まれていないため、foreach ステートメントは 'Task03Entities.Entites' 型の変数に対して操作できません