Ok, this should be simple (I think),
I create a new website in VWD 2005 Express. I create a SQL Database called Photograhy.MDF, it gets saved in the AppData folder. I create one table called Customers with the usual fields (CustomerId-with identity and key set,FirstName, LastName, Address, etc.). Pretty basic and straightforward so far, right?
What I want is a gridview of customers that will edit, delete, and add new customers, and also won't disappear when there are no customers. My solution is this:
I create a GridView, select new datasource. I select the SQL Database Photography.MDF which gets saved in the web.config file as ConnectionString. In the query I select all (*) and in advanced I enable both insert/edit/delete and concurrency. In the GridView smartag I enable paging, editing and deleting. Once again, all very basic, straight out of the online tutorials for GridView. The GridView works great. Paging, editing and deleting work great. I now need a way to insert new records, so I add a FormView.
I add a FormView, create a SQLDataSource2 to ConnectionString, and set the Default Mode for the FormView to Insert. The FormView now adds records to the database (even though I have to page the GridView back and forth to see the new record). But now the GridView won't edit or delete records. Even though the editing fields open, nothing gets updated.
What's goin on? Is there something I need to add to the code? Is this a design issue and is there a better way to accomplish this? TIA for any suggestions.