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
Justin Case
NA
6
623
Entity Framework in DLL
May 23 2018 6:33 AM
I am creating a distributed C# application. One of the parts is a windows service. Another part is a core model dll, containing the classes for all parts of the app. It also has the connection to the DB through Entity Framework.
When i use the DLL in the windows service project and try to save an object to the database through the DLL, it uses the user credentials that the service is running on to access the db, even if I have specified a username/password in the app.config file of the DLL, like so:
<add name="TemplateDBContext" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=EMSCore;User Id=sa;Password=123" providerName="System.Data.SqlClient" />
How can I make sure that the credentials from app.config is always used? I don't want the service user to have DB access, only the hard coded user.
Reply
Answers (
1
)
Timeout exception in threading
time interval in window service