Sally

Sally

  • NA
  • 1
  • 0

html array from dataset

Feb 7 2006 6:24 AM
Hi Does anyone have an example of how to populate an array or collection from a dataset and display it in a table as html links? I have a name search button, user enters text and searches. I run a stored procedure to find the results and currently I display them in a listbox thus, foreach (DataRow DR in DS.Tables["Search"].Rows) { LoadBuffers(DR); //populates vars FN,LN,Key this.ListBox1.Items.Add(new ListItem (Key + "\t\t" + FN + "\t\t" + LN,Key )); } What I’d like to do is display the results as html links in a table instead. I think I need to declare a hyperlink array something like ; HyperLink[] HL = new HyperLink[something!]; And then in the foreach loop do something like person=(DR["FN"].ToString()+" "+DR["LN"].ToString()); HL[DR].Text=person; TableRow TR = new TableRow(); TR.Controls.Add(HL[DR]); this.SomeTable.Controls.Add(TR); I think I’m close but cannot quite get this to work – any advice greatly appreciated. Many thanks.