Click here to Skip to main content
15,851,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I apologise upfront as I am new to Dev and researching this for a solution.

This might not even be a big problem and a common issue.

We have a multi-tenant database that has a tables by customer but dynamic columns. Customer A may have 4 columns and Customer B has 12 columns. More tables can be added that are different. These tables can also be modified (add/delete/move columns) over time for each customer.

Most likely the best storage will be NoSQL for storing this data and structure

We want to read this into our C# but as the tables can vary, we dont want to build or hard code a Class per customer or to have to hard code anything.

We use the returned results info to dynamically build a grid(browser). So if customer A select the table they want, they see the columns relavant to them.

To re-itterate the challenge:
- differing number of columns and formats per customer
- in JSON format (could convert to relational/json store if easier)
- need to de-serialise(?) the data but dont know the field names. These are in a meta table though
- max 100,000 records per customer to be returned
- need to figure out the field format (string, Int):stored in a meta table

What I have tried:

Research options for Dynamic Deserialisation and FastMember
Member 15627495 25-Jan-23 2:42am    
to achieve, you have to count the fields available for a user,
then , for each case you will have the good count of 'column' to use.

it's counting fields before you build the grid.
Gerry Schmitz 25-Jan-23 11:57am    
Nulls, variable length strings, and views.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900