We help IT Professionals succeed at work.
Get Started

SQL connections with either Windows or SQL Authentication in VB.net

281 Views
Last Modified: 2015-03-03
Several years ago, I had developed a VB.NET application that attaches to SQL Server with Windows Authentication that we use at our company.  Recently, I was asked to add a user who is in a non-trusted domain.  I have changed the SQL Server authentication to mixed mode and added the person in Security->Logins and Database->Security->Users.  But honestly, I have no idea what to do next.  I am by no means a professional programmer, but I do have a decent understanding of VB and SQL.  

I really don't want to add a uid and password in an additional connection string in the app.config.  

What I would like to do is have the application check for authentication on load.  If the user has Windows authentication, proceed normally.  If the user has SQL authentication, go to a login screen.  

But I will be happy to entertain other suggestions.  

Any help would be appreciated. Any code snippets would be helpful too.
Comment
Watch Question
Top Expert 2015
Commented:
This problem has been solved!
Unlock 2 Answers and 4 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE