Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORACLE Command设置绑定变量 #107

Closed
snail2015 opened this issue Oct 9, 2019 · 4 comments
Closed

ORACLE Command设置绑定变量 #107

snail2015 opened this issue Oct 9, 2019 · 4 comments

Comments

@snail2015
Copy link

ORACLE Command希望在底层实现设置按参数名进行绑定变量, 方便使用ADO的时候,不按顺序对变量赋值的情况.
protected override DbCommand CreateCommand()
{
return new OracleCommand();
}
应该变更为
protected override DbCommand CreateCommand()
{
var cmd = new OracleCommand();
cmd.BindByName = true;
return cmd;
}

@2881099
Copy link
Collaborator

2881099 commented Oct 9, 2019

BindByName 是不是只有 oracle 才需要设置,除了参数的位置,还有其他影响吗?

@snail2015
Copy link
Author

没有其它影响,如果不设置这个属性,只能严格按照ORACLE参数的顺序进行参数赋值,
否则ODP.NET对参数的取值顺序会按照参数的顺序来,可能造成参数值不匹配的情况

@2881099
Copy link
Collaborator

2881099 commented Oct 9, 2019

好的,代码已改,下次更新好了再通知这个贴

2881099 pushed a commit that referenced this issue Oct 9, 2019
@2881099
Copy link
Collaborator

2881099 commented Oct 9, 2019

v0.10.11 nuget 已经发布

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants