I want to connect to database from my c# windows forms application. I tried using
using(SqlConnection conn = new SqlConnection()) {
conn.ConnectionString = "Data Source=localhost; User Id=root; Password=; Initial Catalog=dbName";
conn.Open();
}
and when I build my project I get an error that server wasn't found or wasn't accessible
.
I tried connecting through data source configuration wizard, but also database can't be found.
I use WAMP
server, and I can find my database through phpMyAdmin
.