用户sa登录失败
后台管理的文件运行时没有问题 ,运行首页就报这个错 首页的代码如下
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.DataToBind();
this.DataToBind7();
this.DataToBind4();
this.DataToBind5();
this.DataToBind6();
this.DataToBind2();
this.DataToBind3();
this.DataToBind8();
this.DataToBind9();
this.DataToBind1();
}
private void DataToBind()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from xinwen where fenlei='温商动态' order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 7, "new");
this.DataList1.DataKeyField = "id";
this.DataList1.DataSource = ds;
this.DataList1.DataBind();
MyConn.Close();
}
private void DataToBind1()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from xinwen where fenlei='新闻热点' order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 6, "new");
this.DataList2.DataKeyField = "id";
this.DataList2.DataSource = ds;
this.DataList2.DataBind();
MyConn.Close();
}
private void DataToBind2()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from gqtd order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 6, "new");
this.DataList3.DataKeyField = "id";
this.DataList3.DataSource = ds;
this.DataList3.DataBind();
MyConn.Close();
}
private void DataToBind3()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from new where fenlei='招商引资' order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 6, "new");
this.DataList4.DataKeyField = "id";
this.DataList4.DataSource = ds;
this.DataList4.DataBind();
MyConn.Close();
}
private void DataToBind4()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from new where fenlei='政策法规' order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 6, "new");
this.DataList5.DataKeyField = "id";
this.DataList5.DataSource = ds;
this.DataList5.DataBind();
MyConn.Close();
}
private void DataToBind5()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from new where fenlei='企业文化' order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 6, "new");
this.DataList6.DataKeyField = "id";
this.DataList6.DataSource = ds;
this.DataList6.DataBind();
MyConn.Close();
}
private void DataToBind6()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from new where fenlei='河套乡友' order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 6, "new");
this.DataList7.DataKeyField = "id";
this.DataList7.DataSource = ds;
this.DataList7.DataBind();
MyConn.Close();
}
private void DataToBind7()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from qiyehy order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 12, "new");
this.DataList8.DataKeyField = "id";
this.DataList8.DataSource = ds;
this.DataList8.DataBind();
MyConn.Close();
}
private void DataToBind8()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from link1 order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 1, "new");
this.DataList9.DataKeyField = "id";
this.DataList9.DataSource = ds;
this.DataList9.DataBind();
MyConn.Close();
}
private void DataToBind9()
{
SqlConnection MyConn = new SqlConnection(ConfigurationManager.AppSettings["DBConnectionString"]);
MyConn.Open();
SqlCommand cmd = new SqlCommand("select * from link1 order by id Desc", MyConn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, 0, 1, "new");
this.DataList11.DataKeyField = "id";
this.DataList11.DataSource = ds;
this.DataList11.DataBind();
MyConn.Close();
}
}