主题:求教“/MsdnSqlPager”应用程序中的服务器错误。
“/MsdnSqlPager”应用程序中的服务器错误。
--------------------------------------------------------------------------------
从索引 0 处开始,初始化字符串的格式不符合规范。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.ArgumentException: 从索引 0 处开始,初始化字符串的格式不符合规范。
源错误:
行 54: // Page index is 0-based
行 55: SqlPager1.CurrentPageIndex = Convert.ToInt32(NewPage1.Text) -1;
行 56: SqlPager1.DataBind();
行 57: }
行 58:
源文件: c:\Documents and Settings\柳生飘絮\桌面\MsdnSqlPager\WebForm2.aspx.cs 行: 56
堆栈跟踪:
[ArgumentException: 从索引 0 处开始,初始化字符串的格式不符合规范。]
System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +1286
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +115
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +99
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +52
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +25
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +141
System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +38
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +21
System.Data.SqlClient.SqlDataAdapter..ctor(String selectCommandText, String selectConnectionString) +51
DevCenter.SqlPager.FetchAllData() +211
DevCenter.SqlPager.DataBind() +325
DevCenter.WebForm2.Go1_Click(Object sender, EventArgs e) in c:\Documents and Settings\柳生飘絮\桌面\MsdnSqlPager\WebForm2.aspx.cs:56
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +97
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.42
高分请教。。。。。
--------------------------------------------------------------------------------
从索引 0 处开始,初始化字符串的格式不符合规范。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.ArgumentException: 从索引 0 处开始,初始化字符串的格式不符合规范。
源错误:
行 54: // Page index is 0-based
行 55: SqlPager1.CurrentPageIndex = Convert.ToInt32(NewPage1.Text) -1;
行 56: SqlPager1.DataBind();
行 57: }
行 58:
源文件: c:\Documents and Settings\柳生飘絮\桌面\MsdnSqlPager\WebForm2.aspx.cs 行: 56
堆栈跟踪:
[ArgumentException: 从索引 0 处开始,初始化字符串的格式不符合规范。]
System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +1286
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +115
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +99
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +52
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +25
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +141
System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +38
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +21
System.Data.SqlClient.SqlDataAdapter..ctor(String selectCommandText, String selectConnectionString) +51
DevCenter.SqlPager.FetchAllData() +211
DevCenter.SqlPager.DataBind() +325
DevCenter.WebForm2.Go1_Click(Object sender, EventArgs e) in c:\Documents and Settings\柳生飘絮\桌面\MsdnSqlPager\WebForm2.aspx.cs:56
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +97
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.42
高分请教。。。。。