标签: connection-string

实体框架:路径中的非法字符.(连接字符串)(MVC3)

我只是无法解决这个问题:

我正在尝试在我的MVC3项目中使用实体框架.但每次我打电话时都会Entities context = new Entities(); 收到此错误:路径中的字符非法.我知道这与我的connectionstring有关,如下所示:

metadata=res://*/Models.Model.csdl|res://*/Models.Model.ssdl|res://*/Models.Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=databasename;Persist Security Info=True;User ID=username;Password=password;MultipleActiveResultSets=True"
Run Code Online (Sandbox Code Playgroud)

我使用Reflector来查明是否正确嵌入我的程序集中的资源,答案是肯定的,它们完全嵌入我的程序集中作为Models.Model.csdl,.ssdl和.msl ...

我的模型与我正在尝试连接的程序集相同,并且未被引用,这意味着通配符*应该可以正常工作.

ConnectionString与向导生成的完全相同......

[ArgumentException: Illegal characters in path.]
   System.IO.Path.CheckInvalidPathChars(String path) +142
   System.IO.Path.Combine(String path1, String path2) +46
   System.Web.Compilation.DiskBuildResultCache.GetBuildResult(String cacheKey, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate) +41
   System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode, Boolean ensureIsUpToDate) +237
   System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate) +162
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +91
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc entity-framework connection-string .net-4.0

5
推荐指数
1
解决办法
3209
查看次数

"Microsoft.ACE.OLEDB.14.0"提供程序未在本地计算机上注册

我使用ms访问作为数据库.mdb文件

如何获取ms访问驱动程序2007.

我收到错误:'Microsoft.ACE.OLEDB.14.0'提供程序未在本地计算机上注册.

c# sql ms-access connection-string

5
推荐指数
1
解决办法
2万
查看次数

实体框架代码第一个DbContext在编译期间检查ConnectionString?

似乎Code First DbContext在编译期间真的使用了给定的ConnectionString吗?我甚至不知道这是怎么可能的,但对我来说似乎是这样.如果我关闭我的本地SQL Server,我收到错误,指出"无法获取DbContext类型的MetadataWorkspace ...".打开SQL Server,一切都编译好了.

这是我的上下文的一部分(我使用的是现有的数据库,是的,我知道,实际上并不是第一个代码)

public class MyContext : DbContext
{
    public MyContext() : base("MY_DYNAMIC_CONNECTIONSTRING")
    {
        Database.SetInitializer<MyContext>(null);
    }
    ...
Run Code Online (Sandbox Code Playgroud)

如果确实如此,那就是一个很大的问题.我怎么能阻止它呢?如果我使用ConnectionString不起作用的单独构建机器怎么办?或者我做错了什么?有什么建议?

entity-framework connection-string code-first wcf-ria-services ef-code-first

5
推荐指数
1
解决办法
3676
查看次数

初始化字符串的格式不符合从azure上的索引0开始的规范

几个小时以来一直有这个问题,这是我的关系:

<connectionStrings>
   <add name="OL4RENTDb" 
     connectionString="Server=v812xrqz2w.database.windows.net;Database=ol4rentDB;User ID=AdminOL4RENT@v812xrqz2w;Password=Grupo501TSI;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient" />
 </connectionStrings>
Run Code Online (Sandbox Code Playgroud)

一个错误:

[ArgumentException: Format of the initialization string does not conform to specification starting at index 0.]
   System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +5314705
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +124
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +95
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +59
Run Code Online (Sandbox Code Playgroud)

你觉得那里有什么问题吗?

我正在部署到azure ..

entity-framework connection-string

5
推荐指数
1
解决办法
5765
查看次数

无法读取配置节'connectionStrings',因为它缺少节声明

我正在尝试将我的网页(c#)移动到ISS 7.5服务器.

我已经读过我需要在WEBCONFIG中实现与sql server 2008的连接.

我已经这样做了.

这是我的WEBCONFIG

<?xml version="1.0" encoding="UTF-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionstrings>
   <!-- <remove name="LocalSqlServer" /> -->
    <add name="conexionsql" connectionstring="Data Source=FCH-DESARROLLO;Initial Catalog=DesaInterno;Integrated Security=True;User ID=usuario_de_conexion;Password=a"
     providerName="System.Data.SqlClient"/>
  </connectionstrings> 


  <system.web>

    <!--<identity impersonate="true" /> -->

    <compilation debug="true" targetFramework="4.5">
      <assemblies>
        <!--  <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> -->
        <add assembly="*" />
      </assemblies>
    </compilation>
   <!-- <httpRuntime targetFramework="4.5"/> -->
  <!--  <authentication mode="Windows" /> -->
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>


 <!-- <system.webServer> --> …
Run Code Online (Sandbox Code Playgroud)

c# connection-string database-connection c#-4.0

5
推荐指数
1
解决办法
1万
查看次数

Advantage ADT文件的连接中的排序规则错误5175

我正在VB.NET中开发一个必须连接到表Advantage(ADT)的应用程序

我使用以下连接字符串:

DSN=kantechX;DataDirectory=C:\DB\Data;SERVER=NotTheServer;
Compression=Never;DefaultType=Advantage;Rows=False;
collation=SPANISH_VFP_CI_AS_1252;AdvantageLocking=ON;Locking=Record;
MemoBlockSize=64;MaxTableCloseCache=5;ServerTypes=1;
TrimTrailingSpaces=False;EncryptionType=RC4;FIPS=False
Run Code Online (Sandbox Code Playgroud)

建立连接后,将产生以下错误:

错误7200:AQE错误:状态= HY000;NativeError = 5175 [iAnywhere解决方案] [SQL优势] [ASA]错误5175:创建的索引文件与当前使用的排序规则不同。表名:卡

我们还使用Advantage Data Architect 1110尝试了连接,并且在打开表时显示此错误:

错误7200:AQE错误:状态= HY000;NativeError = 5209 [iAnywhere解决方案] [SQL优势] [ASA]错误5209:使用了不同的排序规则,这可能导致查询优化不佳。表排序规则:(无),排序规则索引:SPANISH_VFP_CI_AS_1252表名称:Card

架构师要求对表重新编制索引,当我们执行该操作时,它不会显示警报2,但是当我们尝试从vb.net与ODBC连接时,异常会保留第一条错误消息。

我已经检查了adslocal.cfg文件,但没有发现任何有用的东西

我怎么解决这个问题?

vb.net connection-string advantage-database-server

5
推荐指数
1
解决办法
692
查看次数

连接到SSRS中的数据源时出错

我正在尝试连接到Datasource,但收到此错误:

An error occurred during local report processing. 
An error has occurred during report processing. 
Cannot create a connection to data source 'PO'.
You have specified integrated security or credentials in the connection string for the data source, but the data source is configured to use a different credential type. To use the values in the connection string, you must configure the unattended report processing account for the report server.
Run Code Online (Sandbox Code Playgroud)

知道如何解决这个问题吗?

谢谢Aruna

connection-string datasource credentials reporting-services ssrs-2008-r2

5
推荐指数
1
解决办法
3385
查看次数

Azure WebJob存储连接

我的Azure WebJob的App.config中有这些连接字符串

<add name="AzureWebJobsDashboard" connectionString="UseDevelopmentStorage=true"/>
<add name="AzureWebJobsStorage" connectionString="UseDevelopmentStorage=true"/>
Run Code Online (Sandbox Code Playgroud)

因为我希望它默认为开发人员使用Azure存储模拟器。但是,在Azure上使用这些WebJob时,尽管我已在Azure Portal界面中设置了以下连接字符串,但它们似乎仍指向本地存储:

Azure门户应用程序设置连接字符串

我推断它仍指向本地存储,因为出现此错误:

Microsoft.WindowsAzure.Storage.StorageException:无法连接到远程服务器---> System.Net.WebException:无法连接到远程服务器---> System.Net.Sockets.SocketException:尝试访问以受System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,SocketAddress socketAddress)在System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,Socket s4,Socket s6,套接字和套接字,IP地址和地址,ConnectSocketState状态,IAsyncResult asyncResult,Exception&异常)

在第一步的日志记录中,我们尝试连接到Azure存储。

我想念什么吗?我是否为WebJobs正确设置了连接字符串?如何为开发人员将它们设置为默认存储在本地存储中,但在Azure中运行的应用程序具有真实的连接字符串?

.net connection-string azure azure-storage

5
推荐指数
1
解决办法
855
查看次数

在Docker中运行ASP.NET Core App作为自定义用户运行

我有一个ASP.NET应用程序的核心连接到使用数据库Integrated Security=True连接字符串中,从而使运行该应用程序的用户的凭据用于连接到数据库,这样我就不必添加用户名和密码User Id=username;Password=password在连接字符串.

如何使用我的域中的用户帐户运行上述应用程序的Docker容器.这是我能做的事情吗?如果是这样,它仍然是推荐的方法吗?这似乎可以使用Windows容器但是linux呢?

connection-string runas integrated-security docker asp.net-core

5
推荐指数
1
解决办法
568
查看次数

如何获取Oracle数据库的SID,服务名称和端口?

我有在地址xx.xx.xx.xx上运行的oracle数据库,我知道登录名,密码和初始目录

我正在尝试在Oracle SQL Developer中建立新的连接,以便可以访问该数据库以进行查看。为此,我需要知道SID或服务名称。

很久以前,我将运行TNSPing.exe来获取服务名称,但是该程序不再可用。Oracle没有分发它。

有没有办法在某个地方访问此信息?

谢谢

oracle connection-string database-connection tnsping

5
推荐指数
1
解决办法
2万
查看次数