Skip to content

mdw-archives/DatabaseAccessTutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here's an example of setting up a very simple database and querying it - all with raw sql statements via
the interface of the System.Data.IDbConnection object.

I'm using the System.Data.SQLite .dll, which is not native to the .NET framework, I downloaded it and
referenced it within this project from within the lib folder.  I placed the connection string stuff in
an application configuration file called App.config which, ideally, allows you to swap out the 
database without having to change code and recompile.  

Let me know if you have any quesitons or if this won't run.  

You should just be able to hit F5 and see the output of 'John Smith' as he has the 'PersonId' of 
'1' and that is what the query looks for.

A good experiment after running the program and poking around a bit would be to swap out SQLite for 
SQL Server.

About

Simple example using basic database abstractions from System.Data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages