新闻发布系统代码首页
Default,aspx.cs代码如下:
using System;
using System.Data;
using System.Configuration;
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.OleDb;
using System.Data;
using System.Data.Common;
using System.ComponentModel;public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //页面初始化
        if (!IsPostBack)
        {
            //创建数据库连接,读取新闻信息
            string strDBPath = System.Configuration.ConfigurationSettings.AppSettings["DBPath"];
            string   strConn = System.Configuration.ConfigurationSettings. AppSettings["Connection"] + Server.MapPath(strDBPath);
            OleDbConnection myConnection = new OleDbConnection(strConn);
            OleDbDataAdapter myCommand = new OleDbDataAdapter("select top 10 * FROM News WHERE typeid=1 order by Dtime desc", myConnection);            OleDbDataAdapter myCommand1 = new OleDbDataAdapter("select top 10 * FROM News WHERE typeid=2 order by Dtime desc", myConnection);
            DataSet ds = new DataSet();
            myCommand.Fill(ds, "News");
            myCommand1.Fill(ds, "Type");
            //为DataGrid绑定数据源
            MyList.DataSource = ds.Tables["News"].DefaultView;
            MyList1.DataSource = ds.Tables["Type"].DefaultView;
            MyList.DataBind();
            MyList1.DataBind();
            myCommand.Dispose();
            myCommand1.Dispose();
        }    }
   
}
提示信息是“从索引 0 处开始,初始化字符串的格式不符合规范”怎么回事?