求高手!!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class photoAlbum : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Bing();
}
}
public void Bing()
{
string SQL = "select * from TypeIMG ";
Jerry.SQLServer db = new Jerry.SQLServer();
DataSet ds = db.select(SQL);
Repeater1.DataSource = ds.Tables["content"].DefaultView; Repeater1.DataBind();
}
}
运行时出现未将对象引用设置到对象的实例。到底是哪里出现错误了啊????
[解决办法]
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;public partial class photoAlbum : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Bing(); } } public void Bing() { string SQL = "select * from TypeIMG "; Jerry.SQLServer db = new Jerry.SQLServer(); DataSet ds = db.select(SQL); Repeater1.DataSource = ds; Repeater1.DataBind(); }}