TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Charlie
NA
7
9.3k
Multiple SQL connection strings
Oct 11 2015 7:46 AM
I have a winforms application & depending on the user selection regarding SQL authentication there are 2 possible connection strings :-
- using (var con = new SqlConnection(String.Format("Data Source={0}; database={1}; Integrated Security=True", Sql_ServerName, Sql_DataBaseName)))
- using (var con = new SqlConnection(String.Format("Data Source={0}; database={1}; User id={2}; Password={3};", Sql_ServerName, Sql_DataBaseName, txt_SqlAuth_UserName.Text, txt_SqlAuth_Password.Text)))
First one is for windows authentication with the second being a facility for entering a specific username/password for the SQL server (sa for example).
Apart from these con strings the remainder of the code is the same. How can I do an IF/THEN type statement depending on which selection the user has made??
I have attempted an IF/THEN & also declaring the var con in the variables block, both without success.
Any tips, pointer etc?
Reply
Answers (
1
)
Determine each kind of clicking!!!
Need a small application in C#