从索引 34 处开始,初始化字符串的格式不符合规范
public partial class Default2 : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e)
{
string Constr = "Provider =Microsoft.Jet.OLEDB.4.0;Data Source" + Server.MapPath("user.mdb");
OleDbConnection conn = new OleDbConnection(Constr);
try
{
//打开数据库
conn.Open();
OleDbDataAdapter oa = new OleDbDataAdapter("select * from what", conn );
DataSet ds = new DataSet();
oa.Fill(ds, "custom");
GridView1.DataSource = ds;
GridView1.DataBind();
}
catch { }
finally
{
//关闭数据库
conn.Close();
}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataBind();
}
}
问题出现在红色这里,请各位帮帮忙看下!
[ 本帖最后由 易小川 于 2011-3-20 16:59 编辑 ]