SQL Server named pipes error has nothing to do with the pipe

I got a ASP.NET project with a integrated SQL Express database in to App_data folder like below

 image

When I click on F5 into debug mode and I try out some database operation, I got hit by the following error message.

Connection Error: (provider: Shared Memory Provider, error: 0 – No process is on the other end of the pipe.

Peek into SQL Server Configuration Manager and I see that Named Pipes is enable

image

So what is wrong with it? My network is OK

image

After searching the web I realized that SQL Server Agent service got disabled and it can cause problem with database in App_data folder. Open up the Services MMC and confirmed this.

image

So I enabled the SQL Server Agent service and got it started and my ASP.NET can functions per normal. :)

No guarantee it will work for your scenario though.

Default to Edit mode in ASP.NET 3.5 ListView

ListView control gives you the flexibility of control the layout of your form. But when it comes to setting a Edit page using ListView such as the one for DetailView, you will realize it does not come with DefaultMode. For ListView you use the EditIndex property to set to something then the Edit view will be rendered by default.

<asp:ListView ID="ListView1" runat="server"
                DataSourceID="ContactInfoDataSource" EditIndex="0" >

Note that EditIndex is zero based, below is the explanation from MSDN

You can use the EditIndex property to programmatically specify or determine which item in a ListView control to edit. When this property is set to the index of an item in the control, that item is displayed in edit mode. In edit mode, the item is rendered by using the EditItemTemplate template instead of the ItemTemplate template. You can populate the EditItemTemplate with data-bound controls to enable users to modify values for the item. To switch from edit mode to display mode, set this property to -1.