C# ASP.NET MVC3请求的名称有效,但未找到请求类型的数据

C# ASP.NET MVC3请求的名称有效,但未找到请求类型的数据,c#,asp.net,asp.net-mvc,asp.net-mvc-3,entity-framework-5,C#,Asp.net,Asp.net Mvc,Asp.net Mvc 3,Entity Framework 5,NET MVC3和Entity Framework 5(DB First)应用程序以及对DB的所有访问都会引发相同的错误 The requested name is valid, but no data of the requested type was found Description: An unhandled exception occurred during the execution of the current web request. Please review the sta

NET MVC3和Entity Framework 5(DB First)应用程序以及对DB的所有访问都会引发相同的错误

The requested name is valid, but no data of the requested type was found

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.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found

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: 


[SocketException (0x2afc): The requested name is valid, but no data of the requested type was found]
   System.Net.Dns.GetAddrInfo(String name) +6603626
   System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) +106
   System.Net.Dns.GetHostEntry(String hostNameOrAddress) +109
   MySql.Data.Common.StreamCreator.GetDnsHostEntry(String hostname) +75

[Exception: Call to GetHostEntry failed after 00:00:00 while querying for hostname 'xxxxxxxx.db.1and1.com': SocketErrorCode=NoData, ErrorCode=11004, NativeErrorCode=11004.]
   MySql.Data.Common.StreamCreator.GetDnsHostEntry(String hostname) +349
   MySql.Data.Common.StreamCreator.GetHostEntry(String hostname) +36
   MySql.Data.Common.StreamCreator.GetStreamFromHost(String pipeName, String hostName, UInt32 timeout) +70
   MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) +204
   MySql.Data.MySqlClient.NativeDriver.Open() +370

[MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
   MySql.Data.MySqlClient.NativeDriver.Open() +428
   MySql.Data.MySqlClient.Driver.Open() +22
   MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) +218
   MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +287
   MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() +93
   MySql.Data.MySqlClient.MySqlPool.GetConnection() +65
   MySql.Data.MySqlClient.MySqlConnection.Open() +543
   System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +44

[EntityException: The underlying provider failed on Open.]
   System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +203
   System.Data.EntityClient.EntityConnection.Open() +104
   System.Data.Objects.ObjectContext.EnsureConnection() +75
   System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +41
   System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +36
   System.Data.Entity.Internal.Linq.InternalQuery`1.GetEnumerator() +72
   System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() +23
   System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator() +40
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +369
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   domvaproject.Controllers.PropiedadesController.Index() +21
   lambda_method(Closure , ControllerBase , Object[] ) +62
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +182
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +56
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +256
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +22
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +190
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +311
   System.Web.Mvc.Controller.ExecuteCore() +105
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +88
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +34
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +31
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +23
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +59
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9628700
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
请求的名称有效,但未找到请求类型的数据
描述:执行当前web请求期间发生未处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源。
异常详细信息:System.Net.Sockets.SocketException:请求的名称有效,但未找到请求类型的数据
源错误:
在执行当前web请求期间生成了未经处理的异常。有关异常的起源和位置的信息可以使用下面的异常堆栈跟踪来识别。
堆栈跟踪:
[SocketException(0x2afc):请求的名称有效,但未找到请求类型的数据]
System.Net.Dns.GetAddrInfo(字符串名)+6603626
System.Net.Dns.InternalGetHostByName(字符串主机名,布尔值includeIPv6)+106
System.Net.Dns.GetHostEntry(字符串hostNameOrAddress)+109
MySql.Data.Common.StreamCreator.GetDnsHostEntry(字符串主机名)+75
[异常:在00:00:00之后查询主机名“xxxxxxxx.db.1and1.com”时调用GetHostEntry失败:SocketErrorCode=NoData,ErrorCode=11004,NativeErrorCode=11004。]
MySql.Data.Common.StreamCreator.GetDnsHostEntry(字符串主机名)+349
MySql.Data.Common.StreamCreator.GetHostEntry(字符串主机名)+36
MySql.Data.Common.StreamCreator.GetStreamFromHost(字符串管道名、字符串主机名、UInt32超时)+70
MySql.Data.Common.StreamCreator.GetStream(UInt32超时)+204
MySql.Data.MySqlClient.NativeDriver.Open()+370
[MySqlException(0x80004005):无法连接到任何指定的MySQL主机。]
MySql.Data.MySqlClient.NativeDriver.Open()+428
MySql.Data.MySqlClient.Driver.Open()+22
MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder设置)+218
MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()+287
MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()+93
MySql.Data.MySqlClient.MySqlPool.GetConnection()+65
MySql.Data.MySqlClient.MySqlConnection.Open()+543
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(布尔openCondition、DbConnection StoreConnectionOpen、DbConnection originalConnection、字符串例外代码、字符串尝试操作、布尔和closeStoreConnectionOnFailure)+44
[EntityException:基础提供程序在打开时失败。]
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(布尔openCondition、DbConnection StoreConnectionOpen、DbConnection originalConnection、字符串例外代码、字符串尝试操作、布尔和closeStoreConnectionOnFailure)+203
System.Data.EntityClient.EntityConnection.Open()+104
System.Data.Objects.ObjectContext.EnsureReconnection()+75
System.Data.Objects.ObjectQuery`1.GetResults(可为null`1 forMergeOption)+41
System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()+36
System.Data.Entity.Internal.Linq.InternalQuery`1.GetEnumerator()+72
System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()+23
System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()+40
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)+369
System.Linq.Enumerable.ToList(IEnumerable`1源)+58
domvaproject.Controllers.PropiedadesController.Index()+21
lambda_方法(闭包、控制器基、对象[])+62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase控制器,对象[]参数)+14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext ControllerContext,IDictionary`2参数)+182
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext ControllerContext,ActionDescriptor ActionDescriptor,IDictionary`2参数)+27
System.Web.Mvc.c__显示类15.b__12()+56
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter筛选器、ActionExecutingContext预文本、Func`1 continuation)+256
System.Web.Mvc.c__显示类17.b__14()+22
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext ControllerContext,IList`1筛选器,ActionDescriptor ActionDescriptor,IDictionary`2参数)+190
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext ControllerContext,String actionName)+311
System.Web.Mvc.Controller.ExecuteCore()+105
System.Web.Mvc.ControllerBase.Execute(RequestContext-RequestContext)+88
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext RequestContext)+10
System.Web.Mvc.c__显示类b.b__5()+34
System.Web.Mvc.Async.c__显示类1.b__0()+19
System.Web.Mvc.Async.c_uuuudisplayClass8`1.b_uuuu7(IAsyncResult)+10
System.Web.Mvc.Async.WrappedAsyncResult`1.End()+55
System.Web.Mvc.c_uuudisplayClasse.b_uuud()+31
System.Web.Mvc.SecurityUtil.b___0(操作f)+7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(操作)+23
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)+59
System.Web.Mvc.MvcHandler.System.Web.IHTTPassynchandler.EndProcessRequest(IAsyncResult结果)+9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+9628700
System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成)+155

我的主机提供商(1和1)告诉我这个问题是我的,但我认为这个问题是由DNS中的某个错误引起的。他们告诉我错误在代码中,但每次连接都会崩溃

由于我的连接字符串,我得到了相同的错误。它包括一个端口号,但正确的连接字符串必须如下所示:

<add name="myConnectionString" connectionString="Server=localhost;Database=mydatabase;Uid=root;Pwd=password;Allow Zero Datetime=true" providerName="MySql.Data.MySqlClient"/>

您是否尝试过通过IP地址连接以排除DNS问题?我无法尝试,网站已关闭