I have a list of people and addresses in Excel and want to make a small app where choosing an address shows that person’s details. I’m considering a C# Windows Forms app, but I’m not sure how to connect it to the data or package it as an executable. What would be a sensible place to start?
What’s a simple way to make an address list show someone’s details?
Answers
For a small project, you may not need a full database at first. Export the spreadsheet as a CSV file, load its rows in C#, and let the user pick an address from a list. When an address is selected, look up the matching row and show the person’s details in another part of the form.
That keeps the first version straightforward. Be careful to use a unique ID for each person rather than assuming an address will always be unique.
Reply to this answer
If you want to keep editing the data in Excel, you can read the workbook from your C# program with a spreadsheet-reading library. That can work, but it adds a dependency and you’ll need to decide what happens if the file is moved, renamed, or open while the app is using it.
I’d first get the interface working with a small sample file, then decide whether Excel is still the right storage format once you know how the app will be used.
Reply to this answer
Access is worth considering if the goal is mainly a simple data-entry and lookup tool. It can store records and provide forms without you building every screen yourself. If the point is to practise C# or make a custom interface, though, a Windows Forms app with a small local database may suit you better.
Reply to this answer
Keep the first version boring: load the records, show addresses in a searchable list, and display the selected person’s information on the same screen. Opening a new window every time a selection changes can get annoying, and it isn’t necessary for this feature.
For sharing the finished app, Visual Studio has publish options that can produce a folder or installer. Try publishing only after the program works on your own machine, and check whether the data file needs to ship alongside it.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions