tags:

views:

395

answers:

1

I havve WPF APP I want to use SQLite How to do such thing?

(BTW I understend how to do such thing in adobe Air but in WPF it's a beeg Question for me so some explanation made on\with comparing how to's is Big +...)

+3  A: 

You can use SQLite in WPF the same way you would use SQL Server, Oracle or any other database -- via ADO.NET or (better) via an object-relational mapper. An ORM is probably a better option because a good ORM will handle things like property change notifications (critical for data binding) for you.

The basic technique you are looking for is to define a model which you will load and save via the ORM, and databind your UI to using data binding. (The full version of this pattern is called model-view-viewmodel or MVVM but as a beginner you probably want to focus on the basics of creating and binding to a domain model first and tackle the more complex aspects of MVVM later.)

For the SQLite / ADO.NET side of things, see System.Data.Sqlite, as covered in answers to your earlier question.

For object-relational mapping, see numerous Stack Overflow questions, especially http://stackoverflow.com/questions/249550/what-orm-frameworks-for-net-do-you-like-best and http://stackoverflow.com/questions/90565/lightweight-alternatives-to-nhibernate.

itowlson