62,269
社区成员
发帖
与我相关
我的任务
分享
SqlConnection Conn = new SqlConnection(strconn);
Conn.Open();
String sql = "select top 5 * from News order by ID desc" ;
SqlDataReader Dr = new SqlDataReader(sql,Conn);
while(Dr.Read())
{
List=List+"<li>"+Dr["Title"].ToString()+"</li>";
}
NoticeList="<ul>"+List+"</ul>";
SqlCommand cmd = new SqlCommand(sql ,conn);
SqlConnection Conn = new SqlConnection(strconn);
Conn.Open();
String sql = "select top 5 * from News order by ID desc" ;
SqlCommand cmd1 = new SqlCommand(sql, conn);
SqlDataReader Dr = cmd1.ExecuteReader();
while(Dr.Read())
{
List=List+"<li>"+Dr["Title"].ToString()+"</li>";
}
NoticeList="<ul>"+List+"</ul>";
SqlConnection Conn = new SqlConnection(strconn);
Conn.Open();
String sql = "select top 5 * from News order by ID desc" ;
SqlCommand cmd = new SqlCommand(sql ,sqlconnetion);
SqlDataReader Dr = cmd.ExecuteReader();
while(Dr.Read())
{
List=List+"<li>"+Dr["Title"].ToString()+"</li>";
}
NoticeList="<ul>"+List+"</ul>";
SqlConnection Conn = new SqlConnection(strconn);
Conn.Open();
String sql = "select top 5 * from News order by ID desc" ;
SqlCommand cmd = Conn.CreateCommand();
cmd.CommandText = sql;
SqlDataReader sdr = cmd.ExecuteReader();
while(Dr.Read())
{
List=List+"<li>"+Dr["Title"].ToString()+"</li>";
}
NoticeList="<ul>"+List+"</ul>";
sdr.Close();
Conn.Close();