大家好,我的问题是从 sql 中检索数据并显示在标签中,但是一旦我无法分隔所有数据中的数据行,所有数据都显示在一行中请帮助
<asp:GridView ID="grid_advertise_2" runat="server" AllowPaging="True" AutoGenerateColumns="False"
GridLines="None" OnPageIndexChanging="GridView2_PageIndexChanging" PageSize="1"
ShowHeader="False" OnSelectedIndexChanged="GridView2_SelectedIndexChanged">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<tr>
<td id="advertise_2">
<asp:Label ID="lbl_advertise_2"
runat="server"
Font-Names="Tahoma"
Font-Size="12pt"
ForeColor="black"
Text='<%# Bind("TitleEn") %>'/>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
在服务器代码中
protected void Page_Load(object sender, EventArgs e)
{
string Path = "Article.aspx";
Session.Add("Path", Path.ToString());
if (!IsPostBack)
{
this.BindGridadvertise1();
this.BindGridadvertise2();
}
}
private void BindGridadvertise1()
{
myConnection c = new myConnection();
SqlDataAdapter da =
new SqlDataAdapter("select * from TblArticleWishka where ID >= 0 ", c.Cnn);
DataSet ds = new DataSet();
da.Fill(ds);
grid_advertise_1.DataSource = ds.Tables[0];
grid_advertise_1.DataBind();
}