If I have my connection string in the web.config like this (added line feeds for better readability):
This error showed up after I compressed the C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA directory. Uncompressing it fixed the error.
You've properly escaped the db filename but not the datasource, therefore it tries to connect to a datasource named "(localdb)11.0", which (most likely) doesn't exist.
Try escaping it properly like this:
SqlConnection cn = new SqlConnection("Data Source=(localdb)\\v11.0;"+
"Initial Catalog=MyDB; Integrated Security=True; "+
"MultipleActiveResultSets=True; AttachDbFilename=D:\\Products.mdf");