Tag Archives: OleDbConnection

Initialize lists from databases without binding in C#

Note that this is a very manual way to initialize lists. Often you can display data more easily by using data binding. In this example, I added the Access database file Books.mdb to the project and set its “Copy to … Continue reading

Posted in controls, database, lists, user interface | Tagged , , , , , , , , , , , , | 1 Comment

Use SQL queries to display master-detail data in C#

This example uses SQL queries to load master-detail data only when it is needed. For quite a while now, the .NET-ish way to manipulate data from a database has been to load it into a DataSet stored in memory and … Continue reading

Posted in ADO.NET, controls, database | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , | 4 Comments

Generate random data in an Access database in C#

This example shows how you can generate random data for students and their test scores in an Access database. I often build examples that manipulate databases. Those examples are more interesting if the database holds lots of data, but it’s … Continue reading

Posted in ADO.NET, algorithms, database | Tagged , , , , , , , , , , , , , , | Leave a comment

Save images in an Access database in WPF and C#

The example Display images in an Access database in WPF and C# shows how you can display images saved in an Access database. Of course that begs the question, “How do you save images in the database in the first … Continue reading

Posted in database, graphics, image processing, Office | Tagged , , , , , , , , , , , , , , , | Leave a comment

Protect a program from SQL injection attacks in C#

This example explains how you can protect a C# application from SQL injection attacks. The techniques can also protect other kinds of programs such as web applications. Recently Russian hackers stole more than 1.6 billion (yes, that’s 1,600,000,000) user names … Continue reading

Posted in database, SQL, system | Tagged , , , , , , , , , , , , | 7 Comments