I am using Visual Studio 2012 Professional with SQL Server 2012 Express. I have created a new Windows Form (C#) project and started out by creating a new data connection and named it MyShop.mdf
. From there I created two tables: Customer
and Order
.
I manually populated the customer table with 6 records and from the data sources tab, dragged it to my form and watched the tool strip appear at the top along with the labels and controls based on the data types I established with the table data.
When I build and run, none of the data I entered into the customer table shows up - it acts as though the table is empty, yet if I go back into 'Show Table Data', everything I entered still remains. Secondly, when I attempt to add a new record via the form, the following error appears:
An attempt to attach an auto-named database for file c:\users\darden\documents\visual studio 2012\Projects\MyShopForm\MyShopForm\bin\Debug\data\MyShop.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Any thoughts to what I am missing? Thanks for your help.