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
Sie Ste
NA
196
186.4k
modify linq to sql in C#
Oct 27 2012 11:07 AM
In a C# 2010 application, I used linq to sql. I did this so I could use the visual designer to drag the sql server 2008 r2 tables onto the designer suraface. This works fine if your development database is the same database where the production database is located.
However my problem is that I now need to move the code from my development database to a user acceptance database. The problem is the database connections are now hard coded into the applications.
Thus my questions are the following:
1. What can I do in the code so the database name is not hard coded? Do I need to modify a constuctor?
2. I would like the database connection information to be obtained from the app. config file.
Thus can you show me code on how to accomplish my goals?
Reply
Answers (
3
)
C# config file
how to send free SMS in windows Application Using C#