Using ConcurrentDictionary
In this section, we will create a WinForms application to load United States Food and Drug Administration (FDA) drug data concurrently from two files. Once loaded to ConcurrentDictionary
, we can perform fast lookups with a National Drug Code (NDC) value to fetch the name. The FDA drug data is freely available to download in several formats from the NDC directory: https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory. We will be working with tab-delimited text files. I have downloaded the product.txt
file and moved about half of the records to a product2.txt
file, duplicating the header row in the second file. You can get these files in the GitHub repository for the chapter at https://github.com/PacktPublishing/Parallel-Programming-and-Concurrency-with-C-sharp-10-and-.NET-6/tree/main/chapter09/FdaNdcDrugLookup:
- Start by creating a new WinForms project in Visual Studio targeting .NET 6. Name the project
FdaNdcDrugLookup...