Category Archives: database

Update a DataTable that is bound to a DataGridView in C#

The example Build a DataTable and bind it to a DataGridView in C# shows how you can bind a DataTable to a DataGridView to display data. This example shows how you can add new data to the display. When the … Continue reading

Posted in controls, database | Tagged , , , , , , , , , , , | Leave a comment

Save several images into Access in C#

The example Save images in an Access database in C# includes an Access database. Unfortunately if you save several images into the database and then open the database in Access, Access removes the images. It just doesn’t seem to understand … Continue reading

Posted in database, graphics, image processing, Office | Tagged , , , , , , , , , , , , , , , , , , | 1 Comment

Load images from an Access database in C#

The post Save images in an Access database in C# explains how to save images in an Access database. This post explains how to load images from an Access display them. Like previous examples, this program uses a SQL statement … Continue reading

Posted in database, graphics, image processing, Office | Tagged , , , , , , , , , , , , , , , , , | 2 Comments

Save images in an Access database in C#

This example shows how you can save images in an Access database. The example Use filenames stored in a database to display images in C# shows how to display images by saving the image file names in a database and … Continue reading

Posted in database, graphics, image processing, Office | Tagged , , , , , , , , , , , , , , , , , | 4 Comments

Use filenames stored in a database to display images in C#

The reason so many people ask how to store and retrieve images in a database is that it’s hard. You need to use a special data type such as the BLOB (Binary Large Object) or MEMO data type depending on … Continue reading

Posted in database, graphics, image processing, user interface | Tagged , , , , , , , , , , , , , , | 2 Comments

Display database records without data binding in C#

Many programs use data binding to display database records. That method is easy (at least as far as the code you write is concerned), but it’s not very flexible. This example shows how you can display database records without data … Continue reading

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

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 a TextFieldParser to read fixed-width data in C#

This example uses a TextFieldParser object to load fixed-width data from a file that contains names and addresses. Each field has a fixed width. Some records also have ZIP+4 format ZIP codes (for example, 08109-2120) and the program should discard … Continue reading

Posted in classes, database, files, parsing | Tagged , , , , , , , , , , , , , , , | Leave a comment

Use a TextFieldParser to read delimited data in C#

This example uses a TextFieldParser object to parse a data file that contains name and address data. The data contains fields delimited by commas and semi-colons. Some records also have ZIP+4 format ZIP codes (for example, 08109-2120) and the program … Continue reading

Posted in classes, database, files, parsing | Tagged , , , , , , , , , , , , , | 2 Comments

Link ComboBox and ListBox data sources in C#

Few people know that you can link ComboBox and ListBox controls to data sources. If you set their DataSource property to an array or other object holding values, the control will display those values. This can be a convenient way … Continue reading

Posted in arrays, controls, database | Tagged , , , , , , , , , , , | Leave a comment