I have been using a static app.config connection string for my program with no issues until I realised that if I want to share my project with the professor the connection to the database is no longer there when moving the program to a new computer.
"Data Source=DESKTOP-etcetc;Initial Catalog=School;Integrated Security=True"
I have been browsing all over the web for a relative connection string that works for me, but most of them don't even work on the main pc..
I have saved the database file to School.mdf
and I am trying to get the program to use this db file from the debug/exe folder, can someone help me with this?
Update
This is the error I am getting now
System.Data.SqlClient.SqlException: 'The database 'C:\USERS\EMIGH\SOURCE\REPOS\SWIMMINGSCHOOL\SWIMMINGSCHOOL\BIN\DEBUG\DATABASE\SCHOOLL.MDF' cannot be opened because it is version 904. This server supports version 852 and earlier. A downgrade path is not supported. Could not open new database 'C:\USERS\EMIGH\SOURCE\REPOS\SWIMMINGSCHOOL\SWIMMINGSCHOOL\BIN\DEBUG\DATABASE\SCHOOLL.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file C:\Users\emigh\source\repos\SwimmingSchool\SwimmingSchool\bin\Debug\Database\Schooll.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.'
Below is the path for the DataDirectory:
C:\Users\emigh\source\repos\SwimmingSchool\SwimmingSchool\bin\Debug
\Database
Is there any other workaround I could try to get this to work on other computers?