Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to get only unique items from data

Status
Not open for further replies.

jamert

Programmer
Dec 9, 2007
80
CA
Hi the data return by a procedure has many GoalTypeIDs
and i would like to display the unique GoalTypeIDs only.
so i'm thinking that i will have to array the types and check to see if they have been used.... i am not having success with this, any suggestions ?

protected void dlGoalsDataBound(object sender, DataListItemEventArgs e)
{
ArrayList Goals = new ArrayList();
foreach (string e.Item in Goals)
{
if (e.IndexOf(Goals) < 0)
{

HyperLink tmpLnk = (HyperLink)e.Item.FindControl("HyperLink1");

Label tmpLbl = (Label)e.Item.FindControl("Label1");

Session["GoalTypeID"] = tmpLbl.Text;

tmpLnk.NavigateUrl = "~/member-area/goals/default.aspx?nav=g&id=" + tmpLbl.Text + "";
}
}
}
 
foreach (string e.Item in Goals)
this is the problem: Goals is empty and e.Item has nothing to do with Goals.

this next problem is
if (e.IndexOf(Goals) < 0)
DataListItemEventArgs doesn't have an IndexOf property.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks for the pointers , i have revampped it a bit, seems better?

protected void dlGoalsDataBound(object sender, DataListItemEventArgs e)
{

ArrayList Goals = new ArrayList();
Goals.Add(dl);

foreach (DataListItem dl in Goals)
{
if (Goals.IndexOf(dl) < 0)
{
.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top