asp.net DetailsView怎么不显示?
我在做一个论坛的东西为什么用编码帮定了DetailsView后从别的页传ID进去后就什么也不现实啊`?下面是帮定的代码请高手帮忙看下有没有错误`~如果没有那他为什么什么也...
我在做一个论坛的东西为什么用编码帮定了DetailsView后从别的页传ID进去后就什么也不现实啊`? 下面是帮定的代码请高手帮忙看下有没有错误`~如果没有那他为什么什么也不现实呢 ?
SqlConnection articleConnect = new SqlConnection(ConfigurationManager.ConnectionStrings["ClubConnectionString"].ToString());
articleConnect.Open();
SqlCommand articleCommand = new SqlCommand("select a.class as class,a.title as title,b.UserID as Userid, a.AddDate as AddDateTime, a.username as username,a.Content as TextMemo,a.replycount from t_Article a,t_user b,t_class c,t_class d where a.class=c.class and a.userid=b.userid and a.ArticleID=" + articleID, articleConnect);
SqlDataReader articleReader = articleCommand.ExecuteReader();
DetailsView1.DataSource = articleReader;
DetailsView1.DataBind();
articleReader.Close();
SqlCommand replyCommand = new SqlCommand("select a.replytext,a.replydate,a.replyseq,b.userid as username from t_reply a,t_user b where a.userid=b.userid and a.articleid=" + articleID, articleConnect);
SqlDataReader replyReader = replyCommand.ExecuteReader();
DataList1.DataSource = replyReader;
DataList1.DataBind();
replyReader.Close();
QQ52794066 展开
SqlConnection articleConnect = new SqlConnection(ConfigurationManager.ConnectionStrings["ClubConnectionString"].ToString());
articleConnect.Open();
SqlCommand articleCommand = new SqlCommand("select a.class as class,a.title as title,b.UserID as Userid, a.AddDate as AddDateTime, a.username as username,a.Content as TextMemo,a.replycount from t_Article a,t_user b,t_class c,t_class d where a.class=c.class and a.userid=b.userid and a.ArticleID=" + articleID, articleConnect);
SqlDataReader articleReader = articleCommand.ExecuteReader();
DetailsView1.DataSource = articleReader;
DetailsView1.DataBind();
articleReader.Close();
SqlCommand replyCommand = new SqlCommand("select a.replytext,a.replydate,a.replyseq,b.userid as username from t_reply a,t_user b where a.userid=b.userid and a.articleid=" + articleID, articleConnect);
SqlDataReader replyReader = replyCommand.ExecuteReader();
DataList1.DataSource = replyReader;
DataList1.DataBind();
replyReader.Close();
QQ52794066 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询