数据库中有三个表,分别是id,publishdate,content,请高手指点一下?谢谢!
代码如下:
private void NoticeBind()
{
SqlCommand Comm = new SqlCommand("GetNoticeInfo",DbConn);
SqlParameter PublishDate = Comm.Parameters.Add("@PublishDate",DateTime.Now.ToShortDateString());
Comm.CommandType = CommandType.StoredProcedure;
try
{
DbConn.Open();
SqlDataReader Dr = Comm.ExecuteReader(CommandBehavior.CloseConnection);
dlNotice.DataSource = Dr;
dlNotice.DataBind();
}
catch
{
}
finally
{
DbConn.Close();
}
}