在我的网站中打开页面时出错

时间:2014-09-22 05:49:31

标签: c# asp.net visual-studio

服务器错误。

不支持关键字:'userid'。

描述:在执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪,以获取有关错误及其在代码中的起源位置的更多信息。

异常详细信息: System.ArgumentException:不支持关键字:'userid'。

来源错误:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

堆栈追踪:

[ArgumentException: Keyword not supported: 'userid'.]
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +6363422
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +122
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +113
   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +35
   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +221
   System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +64
   System.Web.UI.WebControls.SqlDataSource.CreateConnection(String connectionString) +44
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +150
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +27
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +261
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +95
   System.Web.UI.Control.EnsureChildControls() +146
   System.Web.UI.Control.PreRenderRecursiveInternal() +61
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394

版本信息: Microsoft .NET Framework版本:2.0.50727.8009; ASP.NET版本:2.0.50727.8010

1 个答案:

答案 0 :(得分:1)

连接到数据库的连接字符串出现故障。它包含userid,而它应该是user id(之间有空格)。

有关示例,请参阅connectionstrings.com