我想要做的只是在 SQL 数据库中获取月份和日期的日期并将其绑定到转发器中:
正面:
<asp:Repeater ID="rep_content" runat="server">
<ItemTemplate>
<div class="date">
<p><%# Eval("BLG_DATE") %> of <span><%#Eval("BLG_DATE") %></span>
</div>
</ItemTemplate>
</repeater>
背部:
daString = "SELECT * FROM [BLG] INNER JOIN [ACC] ON [BLG].ACC_ID=[ACC].ACC_ID WHERE [BLG].ACC_ID='" + userID + "'";
SqlDataAdapter da = new SqlDataAdapter(daString, conn);
DataTable dt = new DataTable();
da.Fill(dt);
rep_content.DataSource = dt;
rep_content.DataBind();
BLG表:
BLG_ID,ACC_ID,BLG_TITLE,BLG_DES,BLG_DATE,BLG_IMG
输出应该是:
23 of JAN