Hi, i am having a problem as im new to c#. I did an arraylist and store my "uid" and want to put it into a row of pictures
pic 1 , pic 2 , pic 3, pic 4
this is my code for putting the "uid" the arraylist
pofile2.aspx.cs
-
ArrayList list2 = new ArrayList();
-
//query to get uid
-
thesql = "select * from Student where caregroupID= @CareGroupID";
-
-
using (SqlCommand cmd = new SqlCommand(thesql, con))
-
{
-
cmd.Parameters.AddWithValue("CareGroupID", Session["caregroupID"].ToString());
-
con.Open();
-
-
using (SqlDataReader reader = cmd.ExecuteReader())
-
{
-
while (reader.Read())
-
{
-
list2.Add(reader["uid"].ToString());
-
}
-
}
-
Session["horse"] = list2;
-
con.Close();
-
}
-
I understand my Session becomes an object and so i have to cast it back.
This is my aspx page where i tried to cast it.
-
<%ArrayList mylist = (ArrayList)Session["horse"];%>
-
<!--fb:fan profile_id="171381255280" name="caregroup" stream="0" connections="8" width="250"></fb:fan-->
-
</form>
-
<div>
-
<table cellpadding=0 cellspacing=11>
-
<tr>
-
<%for (int i = 0; i < 8; i++)%>
-
<%{ %>
-
<td>
-
<fb:profile-pic uid="<%=mylist[i].ToString()%>" facebook-logo="false" width="50" height="50"linked="true" />
-
</td>
-
<%}%>
-
</tr>
-
</table>
-
</div>
-
But it seems like i can't put the cast at my ASPX page. The error states the namespace arraylist does not exist, Any idea what other solution can be used?