本文介绍了“/”应用程序中的服务器错误 - LINQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到了这个错误。它的工作在当地,但不在线
系统找不到指定的文件
I got this error. Its work local, but not online
The system cannot find the file specified
[Win32Exception (0x80004005): The system cannot find the file specified]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +356
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +117
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +267
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +318
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +132
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +195
System.Data.SqlClient.SqlConnection.Open() +122
System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) +59
System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() +43
System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() +27
System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +70
System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<t>.GetEnumerator() +54
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +432
System.Linq.Enumerable.ToList(IEnumerable`1 source) +70
Blognyhederdp.Page_Load(Object sender, EventArgs e) +284
System.Web.UI.Control.OnLoad(EventArgs e) +109
System.Web.UI.Control.LoadRecursive() +68
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3321
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.81.0
我尝试过:
我在代码隐藏中使用它,它在当地工作
What I have tried:
I use this in codebhind, and its working local
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;
public partial class Blognyhederdp : System.Web.UI.Page
{
DataClassesDataContext db = new DataClassesDataContext();
protected void Page_Load(object sender, EventArgs e)
{
Repeater_Visnyhed.DataSource = db.Posters.OrderByDescending(n => n.Postdate).Take(5).ToList();
Repeater_Visnyhed.DataBind();
}
}
推荐答案
这篇关于“/”应用程序中的服务器错误 - LINQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!