Hello, I'm having trouble with variables for connection strings. In my app.config database path seems fine but on form, I'm getting error for that connection string. When I try to add:
C# Code:
_connectionString = "Data Source = (LocalDB)\\MSSQLLocalDB; " + "AttachDbFilename = \"|DataDirectory|\\gazi_db.mdf\"; " + "Integrated Security = True; Connect Timeout = 30";
the database won't work correctly; it can't save data on exit. However this Works fine:
C# Code:
connectionString = "Data Source = (LocalDB)\\MSSQLLocalDB; " + "AttachDbFilename = \"C:\\Users\\Can\\Desktop\\c_sharp_gazi_installer" + "\\Gazi Installer\\gazi_installer\\gazi_db.mdf\"; " + "Integrated Security = True; Connect Timeout = 30";
How can I fix this?




Reply With Quote
