Tag Archives: OleDbCommand

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

Execute ad hoc SQL commands in C#

This example shows how you can execute ad hoc SQL commands such as CREATE TABLE and INSERT INTO in an Access 2007 database. ADO.NET itself doesn’t provide much in the way of objects to manipulate a database’s structure. Fortunately you … Continue reading

Posted in ADO.NET, database, SQL | Tagged , , , , , , , , , , , , , , | 2 Comments

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