sqlconnection login question

  • Thread starter Thread starter Todd H
  • Start date Start date
T

Todd H

I have created a logon dialog box to collect the userid and password
to create my connection string. This connection is a global variable
for all my forms to use. The reason I did this was when using the
connection wizard (or SQLAdapter wizard) you are forced to use the sa
password not a variable. You can not manually change this in the
initialization code since the textboxes for username and password do
not exist yet.

All the ADO.net books I have read just use the sa password to connect,
not the best practice for some databases. This is causing problems
for future forms since I have to code the Dataset and binding
manually.

Can anyone tell me a better way to obtain the userid and password yet
still use the wizards to simplify coding?
 
Hi Todd,

Two options:
- use integrated security
- put your connection string into app.config file and bind it to
ConnectionText property of each connection instance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top