资源简介
毕业设计网站(审核过),需要的同学可以下载参考()
代码片段和文件信息
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class _Default : System.Web.UI.Page
{
public string npics nlinks ntexts;
protected void Page_Load(object sender EventArgs e)
{
if (!IsPostBack)
{
GetNewsInfo();
GetJingDianInfo();
getsyt();
}
}
private void GetJingDianInfo()
{
string sqlNews = “select top 10 * from TB_JingDian“;
DataSet result = new DataSet();
result = DBHelper.GetDataSet(sqlNews);
if (result != null)
{
if (result.Tables[0].Rows.Count > 0)
{
this.DataList2.DataSource = result.Tables[0];
DataList2.DataBind();
}
else
{
DataList2.DataSource = null;
DataList2.DataBind();
}
}
}
private void GetNewsInfo()
{
string sqlNews = “select top 10 * from TB_News order by id desc “;
DataSet result = new DataSet();
result = DBHelper.GetDataSet(sqlNews);
if (result != null)
{
if (result.Tables[0].Rows.Count > 0)
{
this.GridView1.DataSource = result.Tables[0];
GridView1.DataBind();
}
else
{
GridView1.DataSource = null;
GridView1.DataBind();
}
}
}
private void getsyt()
{
string sql = “ select top 5 * from TB_JingDian where len(TuPian)>0 order by ID desc “;
DataSet result = new DataSet();
result = DBHelper.GetDataSet(sql);
if (result != null)
{
if (result.Tables[0].Rows.Count > 0)
{
int i = 0;
for (i = 0; i < result.Tables[0].Rows.Count; i++)
{
npics = npics + “upload/“ + result.Tables[0].Rows[i][“TuPian“].ToString().Trim() + “|“;
nlinks = nlinks + “JingDianB.aspx?id=“ + result.Tables[0].Rows[i][“id“].ToString().Trim() + “|“;
ntexts = ntexts + result.Tables[0].Rows[i][“BiaoTi“].ToString().Trim() + “|“;
}
}
}
}
}
- 上一篇:ZXing.Net大全
- 下一篇:数字图像处理冈萨雷斯ppt
评论
共有 条评论