VB .NET making blood pressure rise dangerously...

One web form. One sqlconnection, one datagrid.

sql connection string: Data Source=.\SQLEXPRESS;AttachDbFilename=“C:\Program Files\Microsoft SQL Server\MSSQL\Data
orthwnd.mdf”;Integrated Security=True;Connect Timeout=30;User Instance=True

Configuration works great. Tests fine.

Data grid has the sqlconnection as a datasourceid. When running I get the error:

An attempt to attach an auto-named database for file C:\Program Files\Microsoft SQL Server\MSSQL\Data
orthwnd.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Potential solution of deleting folder in SQLExpress folder is no good. Only one folder there.

calm down…calm down…
:mad:

Is there a reason you’re specifying the file name? I’ve never tried that, but from the error you post, it sounds as if it’s trying to create a new DB using that file, which already exists.

Try doing something like:

Data Source=SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True;Connect Timeout=30;User Instance=True

I think I added a sql database object instead of a connection object but I royally screwed up my sql server trying to find out what was wrong. have to reinstall.