Hello ,
You are using SqlServer Compact Edition (.sdf) ,so how could you expect to open the connection using SqlConnection .
to connection with Compact Edition Service you must add
using System.Data.SqlServerCe
this namespace .and use
SqlCeConnection ,SqlCeDataAdapter
instead of
SqlConnection,SqlCommand,and SqlDataReader
last but not the least in the webconfig file add this providername
providerName="Microsoft.SqlServerCe.Client.3.5"
if you are using SqlserverCe 3.5
SqlCeConnection con = new SqlCeConnection("data source=E:\\Jegan Works\\c sharp\\login\\login\\login.sdf;initial catalog=login;");
con.Open();
con.Close()
thanks