configuration mannager error while connecting to sql server

Posted by Chaithragm under WPF on 6/26/2013 | Points: 10 | Views : 926 | Status : [Member] | Replies : 1
hi ,im new to wpf started with simple application of saving and retrieval of data
im using vs2010 and sqlexpress2012
i have created a database in sql .

this my connection string
<connectionStrings>
<add name="myConnectionString" connectionString="Data Source=aaaa;Initial Catalog=Bank;User ID=sa;Password=****;" />
</connectionStrings>

SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
im getting error like configuration manager does not exist in the current context
how to connect to database from window.xaml




Responses

Posted by: Bageshkumarbagi on: 6/26/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Add Reference "System.configuration" in your project.


Thanks,
Bagesh Kumar Singh

Thanks,
Bagesh Kumar Singh
Mark as answer if you have been satisfied

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response