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
darma teja
NA
496
336.8k
Connect database through config file
Jul 21 2012 7:46 AM
Hi,
I want to connect database through configaration file. I am getting error.
Here is my code:
Configuration file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="databaseconnectionstring" connectionString="i wrote connection string here"/>
</connectionStrings>
</configuration>
My code in c# is:
string connStr = ConfigurationManager.ConnectionStrings["databaseconnectionstring"].ConnectionString;
SqlConnection con = new SqlConnection(connStr);
con.open();
Thanks
Darma
Reply
Answers (
10
)
How to implement the cdatabase without using constructor
loading a real time data in vb.