naushad india

naushad india

  • NA
  • 2
  • 739

c# doubt . database connection problem

Mar 31 2018 4:43 PM
Hi, I am naushad from Kerala. (.net student)
 
Please help me !
 
I had created a simple database project in c sharp and make it exe file ans installed it. Its working fine in my system. because sql server is installed. when i installed it in my friends system its not working because it does not have sql server. 
 
Can the project will run without sql server. 
 
or is the  connection string problem 
 
static string path = Path.GetFullPath(Environment.CurrentDirectory);
 
static string databaseName = "ContactDB.mdf";
 
SqlConnection sqlCon = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="+path+@"\"+databaseName+";Integrated Security=SSPI;"); 
 
when i install exe in my system no problem. When on friend's system the form appears. when we add new filed. its not reponding
 
please help...
 
Thanks in advance
Naushad

Answers (2)