表示层 用DataList绑定(根据Id绑定)
<asp:DataList ID="dlshiping" runat="server">
<ItemTemplate>
<object width="420" height="363">
<param name="movie" value="http://www.tudou.com/v/yzxVbxSSu7k"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<param name="wmode" value="opaque"></param>
<embed src='<%#Eval("ShiPingAddress") %>' type="application/x-shockwave-flash" allowscriptaccess="always"allowfullscreen="true" wmode="opaque" width="420" height="363">
</embed>
</object>
</ItemTemplate>
</asp:DataList>
BLL层
public static IList<Work> SelectWorkID(int ID)
{
return WorkService.SelectWorkID(ID);
}
DAL层
public static IList<Work> SelectWorkID(int ID)
{
IList<Work> lisShiPin = new List<Work>();
string sql = "select ShiPingAddress from Work where Id=@ID";
SqlParameter[] par = new SqlParameter[]
{
new SqlParameter("@ID",ID)
};
SqlDataReader read = DBHelper.GetReader(sql, par);
while (read.Read())
{
Work work = new Work();
work.ShiPingAddress = (string)read["ShiPingAddress"];
lisShiPin.Add(work);
}
read.Close();
return lisShiPin;
}