本文介绍了如何检索一列表的所有行并在页面上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有



我想显示表格中一列所有行的列表并将其显示在选框上请告诉我如何执行此操作。我正在尝试执行以下代码,但它只显示最后一行



Dear All

I want to display a list of all the rows of one column of a table and display it on the marquee please tell me how to do this. I am trying to do the following code but it is only displaying a last row

TestDbEntities TE = new TestDbEntities();
      protected void Page_Load(object sender, EventArgs e)
      {
          string[] ids = (from customer in TE.tblUploadeds
                    select customer.Thefile).ToArray();

          foreach(var fn in ids)
          {
              TitleLink.Text = fn.ToString() + "<br />";
          }
      }

推荐答案

TitleLink.Text += fn.ToString() + "<br />";

或者使用一个控件来显示多行,例如GridView。

Or use a control which is intended to show multiple rows such as a GridView.


这篇关于如何检索一列表的所有行并在页面上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 18:06