This is just a heads up to provide a very useful link about .NET provider models and some actual sample code from Microsoft that could be used not just in Sharepoint but in any .NET application.
Here's the link to the page on Microsoft MSDN where you can download sample code from.
ScottGu's blog entry here is also very helpful.
Hope that helps.
-Rajiv