我正在执行查询以从 tbl_message 表获取 Title 和 RespondBY,我想在对转发器进行数据绑定之前解密标题。在进行数据绑定之前如何访问标题值。
string MysqlStatement = "SELECT Title, RespondBy FROM tbl_message WHERE tbl_message.MsgID = @MsgID";
using (DataServer server = new DataServer())
{
MySqlParameter[] param = new MySqlParameter[1];
param[0] = new MySqlParameter("@MsgID", MySqlDbType.Int32);
param[0].Value = MessageID;
command.Parameters.AddWithValue("@MsgID", MessageID);
ds = server.ExecuteQuery(CommandType.Text, MysqlStatement, param);
}
rptList.DataSource = ds;
rptList.DataBind();
<table style="width: 498px; color: #F5F5F5;">
<asp:Repeater ID="rptList" runat="server">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td width="15%">
<b>Subject</b>
</td>
<td width="60%">
<asp:Label ID="lbl_Subj" runat="server" Text='<%#Eval("Title")%>' />
</td>
</tr>
也许,就像下面的代码部分一样,您可以获取标题并在之前尝试此编码
rptList.DataSource = ds;
rptList.DataBind();
下面的代码部分可以获取Titledataset http://msdn.microsoft.com/en-us/library/system.data.dataset%28v=vs.71%29.aspx
string title = ds.Tables[0].Rows[0]["Title"].ToString();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)