如何解决如何解决错误“初始化字符串的格式不符合从索引100开始的规范”
这是我的连接字符串用于本地调试:
connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;
provider=System.Data.SqlClient;
provider connection string="
data source=SFP;
initial catalog=POLLINATORS;
integrated security=True;
MultipleActiveResultSets=True;
App=EntityFramework"
部分堆栈跟踪:
在System.Data.Entity.Core.EntityClient.Internal.DbConnectionOptions处的在System.Data.Entity.Core.EntityClient.Internal.DbConnectionOptions.GetKeyValuePair(字符串connectionString,Int32 currentPosition,StringBuilder缓冲区,字符串和键名,字符串和键值)处。 System.Data.Entity.Core.EntityClient.Internal.DbConnectionOptions..ctor(String connectionString,IList 2 parsetable,String connectionString,IList
1.Initialize()在System.Data.Entity处为ParseInternal(IDictionary 1 validKeywords) at System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) at System.Data.Entity.Core.EntityClient.EntityConnection..ctor(String connectionString) at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name,AppConfig config) at System.Data.Entity.Internal.LazyInternalConnection.Initialize() at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.Initialize() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet
1个有效关键字)。 Internal.Linq.InternalSet 1.get_InternalContext() at System.Data.Entity.Infrastructure.DbQuery
1.System.Linq.IQueryable.get_Provider()
感谢您的帮助! 〜苏珊〜
解决方法
您在提供程序连接字符串中缺少右引号:
connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;
provider=System.Data.SqlClient;
provider connection string="
data source=SFP;
initial catalog=POLLINATORS;
integrated security=True;
MultipleActiveResultSets=True;
App=EntityFramework""
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。