Telerik“Live Demos”解决方案 - 连接字符串&数据库设置

时间:2011-09-08 18:47:08

标签: c# asp.net visual-studio-2008 telerik rad-controls

寻找一位为ASP.NET AJAX Live Demos项目设置Telerik Rad Controls的人......我最近下载了用于ASP.NET AJAX框架的Telerik Rad Controls。我正在使用Telerik Rad Controls for ASP.NET(非AJAX)框架从大约5-6年前升级到我们公司的一些代码到新的AJAX框架。许多旧控件在最新的浏览器版本(Google Chrome 12,Mozilla Firefox,Internet Explorer)中不起作用。有些控件在某些浏览器中有效但在其他浏览器中无效,有时它并不总是与它破坏的浏览器相同。

我尽我所能来解决公司框架中存在的问题,但我们仍然存在一些问题,以前是我的问题。这些是我想要解决的问题。然后我开始安装演示项目。

我们公司尚未使用Visual Studio 2010,所以昨天我将Telerik Live Demos项目降级为Visual Studio 2008.我通过进行3次更改手动转换了* .sln文件。幸运的是,没有 .csproj / .vbproj文件(显然,因为他们的网站项目中都有这两种语言)。然后我将.NET版本从4.0更改为3.5,对网站bin文件夹进行了必要的Bin35更新,删除了项目中的4个不同的.NET 4.0 dll并使用这些程序集卸载了所有文件,在IIS 7中进行了必要的更改,编制了解决方案,一切都很顺利......

直到我尝试查看某些控件。然后我发现他们有2个数据库(Northwind& Telerik)你需要下载( .mdf / .ldf文件)和附加到SQL Server 2008.我今天做了,更新了连接字符串,但是我还有问题。我希望这是我需要解决的许多问题中的最后一个,以使其工作,以便我能理解框架。

仅供参考:我现在正在使用web.config.35文件作为我的“web.config”文件。我还将解决方案/项目的.NET版本从2.0更改为3.5。这个可以吗?我认为这将是因为2.0 dll仍然可以在3.5站点中运行..因为它仍然是2.0架构。

有人可以向我解释所有这些连接字符串的用途和必要的设置吗?我将* .mdf和* .ldf文件附加到SQL Server,但它们仍处于集成模式(用于访问)。我还重命名了数据库...在附加和添加* .mdf文件后,数据库名称真的很长!

web.config连接字符串:

    <connectionStrings>
        <add name="NorthwindConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
        <add name="TelerikConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Telerik.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
        <add name="NorthwindConnectionString35" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
        <add name="TelerikConnectionString35" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Telerik.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
        <add name="NorthwindEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Northwind.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
        <add name="TelerikEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Telerik.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
        <add name="QSFRatingsConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|QSFRatings.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
        <add name="SelfReferencingDbConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|TelerikSelfReferencingDb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
    </connectionStrings>

在Live Demos中查看ComboBox控件时(运行Live Demos网站时)仍然出现此错误:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

Source Error: 

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.  

Stack Trace: 


[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849015
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2394
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4863459
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1297
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
   Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) +635
   Telerik.Web.UI.RadComboBox.PerformSelect() +21
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.RadComboBox.DataBind() +37
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
   System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22
   Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e) +15
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4961; ASP.NET Version:2.0.50727.4955 

1 个答案:

答案 0 :(得分:1)

假设您拥有允许APP将.mdf文件附加到SQL Server的管理员凭据,请设置User Instance = false(编辑:在连接字符串中将其更改为false )。

我认为这就是您目前收到上述错误的原因。不是说这会完全解决你的所有问题,但它可以帮助你解决这个错误。

- 希望有所帮助 -J