Oracle 在命令行上指定数据库
嗨,伙计们 我正在尝试使用以下设置创建连接:Oracle 在命令行上指定数据库,oracle,subsonic,sharpdevelop,Oracle,Subsonic,Sharpdevelop,嗨,伙计们 我正在尝试使用以下设置创建连接: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="fals
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="SubSonicService"
type="SubSonic.SubSonicSection, SubSonic"
requirePermission="false"/>
</configSections>
<connectionStrings>
<add name="SamConnection"
connectionString='Password=myPass;Persist Security Info=True;User ID=myAdmUsr;Data Source=myServer;'
providerName="OLEDB.Oracle.1" />
</connectionStrings>
<SubSonicService defaultProvider="SamConnection">
<providers>
<clear/>
<add name="SamConnection"
type="SubSonic.OracleDataProvider, SubSonic"
connectionStringName="SamConnection"
generatedNamespace="myNameSpace"/>
</providers>
</SubSonicService>
</configuration>
但是使用命令行:sonic generate/db myDB/out Generated
生成的代码是服务器上的第一个DB,不是从myDB生成的。我试图在DB中指定连接字符串,但没有工作,在哪里可以指定
PS:我正在使用sharpdevelop。我认为您可以修改tnsnames.ora文件以将数据库用作默认模式,或者在运行子命令之前设置ORACLE_SID环境变量 或者,根据connectionstrings.com,您可以使用此语法连接到db,而根本不使用tnsnames.ora文件: 但您必须在sqlnet.ora中启用
EZCONNECT
:
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)