When I attempt to either save data entered from a text box to my DB, or search through data in my DB I am presented with an error message of:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Additional information: An attempt to attach an auto-named database for file C: \Users\User\Documents\Visual Studio 2015\Projects\Aaron's WPF Project\Database1.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
I deleted my database, re created it, and re entered the connection string but I'm still presented with this error? Why's this.
Here is my connection string:
SqlConnection Connection = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C: \Users\User\Documents\Visual Studio 2015\Projects\Aaron's WPF Project\Database1.mdf;Integrated Security=True");