I have this following table (I’m thinking of putting this as a datatable, but I’m flexible):
ID(int) Branch(string) Department(string) Available(Boolean)
101 North Sales True
101 North Marketing False
102 North Security True
103 South Sales True
... ... ... ...
I want to be able to query Available through [ID][Branch][Department]
So something like [101]["North"]["Marketing"] would give me False, or at least tell me whether a row containing [101]["North"]["Marketing"] exists or not in the table.
What’s the most efficient way to go about this?
Feel free to suggest some other structure if you think it’s more efficient than a datatable
You can set the DataTable’s PrimaryKey to be the first 3 columns then use DataTable’s Rows.Find(101, “North”, “Marketing”) to fish out the row or get null if it doesn’t exist!