Need help with searching an entity and displaying the results using a DataGridView.
Hello, I am a student currently stuck on this. The idea is to search using the entity's attributes and display all of all instances that contain the queried information. However, I ran into a problem in that when testing it only adds a single instance to the DataGridView, instead of multiple. Help will be greatly appreciated.
9 Replies
I will add pictures to display my problem.
Here is the current contents of my guest table.
This is my query form, the information I've searched is surname, "Charnock" is present twice but it only shows the first instance.
$paste
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
show the query
BlazeBin - npsetbqmqgxj
A tool for sharing your source code with the world!
Several parts are commented and most will be removed
This is my field constructor,
public Guest(DataRow Instance)
{
guestID = int.Parse(Instance["GuestID"].ToString());
surname = Instance["Guest_Surname"].ToString();
forename = Instance["Guest_Forename"] .ToString();
postCode = Instance["PostCode"].ToString();
address = Instance["Address"].ToString();
cardInformation = Instance["Card_Information"].ToString();
}