在运行时传递密码 [英] Passing password at runtime
问题描述
我插入了一个绑定源,然后通过它创建了数据集和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屋!