在命令行 Subsonic 上指定数据库
嗨,大家好 我试图使用这些设置创建连接:
<?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>
但使用命令行: sonicgenerate /db myDB /out 生成 生成的代码是服务器上的第一个数据库,而不是来自 myDB 我试图在数据库中指定连接字符串,但没有成功,我在哪里可以指定它?
PS:我使用的是sharpdevelop。
Hi guys
I was trying to create a connection with these settings:
<?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>
but with the command line: sonic generate /db myDB /out Generated
the code generated is the first DB on server and not from myDB I was trying to specify the connection string in the DB but did not work, where can I specify this?
PS: i'm using sharpdevelop.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以修改 tnsnames.ora 文件以使用数据库作为默认架构,或者在运行子命令之前设置 ORACLE_SID 环境变量。
或者,根据connectionstrings.com,您可以使用此语法连接到数据库,而无需使用tnsnames.ora文件: http://www.connectionstrings.com/oracle
但您必须在 sqlnet.ora 中启用
EZCONNECT
:I think you can either modify your tnsnames.ora file to use your database as a default schema or set the ORACLE_SID environment variable before running subcommander.
Or, according to connectionstrings.com, you can use this syntax to connect to a db without using the tnsnames.ora file at all: http://www.connectionstrings.com/oracle
but you have to enable
EZCONNECT
in sqlnet.ora: