I have a db4o database which i want to use with asp.net web application and i want to databind data from db4o database. How can i do that ?
I'm using VS2008/asp.net with c#
Help me out
Thanks
I have a db4o database which i want to use with asp.net web application and i want to databind data from db4o database. How can i do that ?
I'm using VS2008/asp.net with c#
Help me out
Thanks
It looks like db4o has Linq support. I also found this article An introduction to LINQ for db4o on CodeProject on how to use the Linq to db4o. You'll probably want to read the whole thing but if you want to go directly to the demos, they are about half way down the page.
There are also some more examples in their documentation, including a basic operations (storing, updating, querying and deleting objects) example.
The db4o container.Query<T>()
method returns a Db4objects.Db4o.Internal.Query.GenericObjectSetFacade object, which you can not directly put into a DataGrid. I'm assumig that also happens with a GridView.
Try using Linq extension method ToList<TSource>(this IEnumerable<TSource> source)
:
using System.Linq;
/*...*/
IList<MyClass> db4oList = container.Query<MyClass>();
grid.DataSource = db4oList.ToList();