string dbPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
dbPath = Path.Combine(dbPath, "Database1.mdf");
cn = new SqlConnection (@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory| "+dbPath+";Integrated Security=True");
GetAllRecords();
When I run this code, it displays this error
System.NotSupportedException: 'The given path's format is not supported.'
I want to connect the database located in current user's document folder. How to fix this?