You should be using a connection string that connects to "Microsoft SQL Server" rather than "Microsoft SQL Server Database File".
The errors indicates that you're trying to connect directly to the database file, which isn't the right way to connect to a full-blown SQL Server database, and connecting to a file only works via Express Edition.