How do I bind an ASP.NET FormView to a single record? How do I bind an ASP.NET FormView to a single record? asp.net asp.net

How do I bind an ASP.NET FormView to a single record?


As the error message says, the DataSource object must implement IListSource, IEnumerable or IDataSource to work.

If you have an object av type A which do not implement one of the mentioned interfaces then you could as you say wrap your object in a list:

C#

var myDataSource = new List<A> {myObject};

VB.NET

Dim myDataSource As List(Of A)(myObject)