2011-09-08 48 views
0

寻找一个人谁设置的Telerik Rad Controls for ASP.NET AJAX Live Demos项目之前......我最近下载了Telerik Rad Controls for ASP.NET AJAX框架。我正在使用Telerik Rad Controls for ASP.NET(非AJAX)框架将我们公司的一些代码从大约5-6年前升级到新的AJAX框架。许多旧控件在最新的浏览器版本(Google Chrome 12,Mozilla Firefox,Internet Explorer)中无法使用。有些控件在某些浏览器中可用,但在其他浏览器中不起作用,有时并不总是与浏览器打开的浏览器相同。Telerik“Live Demos”解决方案 - 连接字符串和数据库设置

我尽最大努力解决了我们公司框架中存在的问题,但我们仍然存在一些问题,以前我发布过的问题都是如此。这些正是我想要解决的问题。于是我开始安装演示项目。

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

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

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

有人可以向我解释所有这些连接字符串的用途和必要的设置?我有连接到SQL Server的* .mdf和* .ldf文件,但它们仍处于集成模式(用于访问)。我也重新命名了数据库...在附加和添加* .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> 

在现场演示观看ComboBox控件时(运行现场演示网站时)仍收到此错误:

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

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

我会认为这就是为什么你目前得到上面的错误。不是说这会完全解决你所有的问题,但它应该帮助你解决这个错误。

-Hope,帮助 -J

+0

张贴在此基础上一个新的问题..因为这并没有完全解决我的问题。 http://stackoverflow.com/questions/7366295/sqlexpress-connection-fails-in-iis-7-w-user-instance-error-failed-to-generate – MacGyver

+0

在这里回应,所以我不堵塞那新鲜的职位,但是您提到您在SQL服务器下以“网络服务”用户身份登录。您是否尝试过使用本地系统(在SQL Server属性选项卡中的登录选项卡下)?如果是这样,结果是什么? – KreepN

+0

绝对..让我检查错误是什么(如果我记得..同样的错误) – MacGyver