Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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
Posted

Very easy..........
TableAdapter.connection.connectionstring + = ";Password=abc123"
 
Share this answer
 
use sqlparameters see this[^] article on CP
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900