在运行时传递密码 [英] Passing password at runtime

查看:54
本文介绍了在运行时传递密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我插入了一个绑定源,然后通过它创建了数据集和tableadapter.
在我的连接字符串中,未选择向其包括敏感数据(密码)

现在,当应用程序运行时,它会显示无效密码"并崩溃.
当然,这是我们的期望.
现在我的问题是,我希望我的应用程序加载我在变量中传递的密码,例如vrMyPWD在加载之前为string ="abc123"

Me.TblInvoicesTableAdapter.Fill(Me.DbInvoicesDataSet.tblInvoices)

在from_load.因此没有错误,应用程序可以正常工作.

请指导.
谢谢

Hi,
I inserted a bindingsource and then created dataset and tableadapter through it.
In my connectionstring, did not select to include sensitive data to it (password)

Now when the application runs, it says Invalid Password and crashes.
Off course it is what we expect.
Now my question is, I want my application to load password that I have passed in a variable e.g. vrMyPWD as string="abc123" before it loads

Me.TblInvoicesTableAdapter.Fill(Me.DbInvoicesDataSet.tblInvoices)

at from_load. So there is no error and application works normally.

Please guide.
Thanks

推荐答案

很容易..........
TableAdapter.connection.connectionstring + =; Password = abc123"
Very easy..........
TableAdapter.connection.connectionstring + = ";Password=abc123"


使用sql参数请参阅 ^ ]文章
use sqlparameters see this[^] article on CP


这篇关于在运行时传递密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆