I have a project where a client can import an excel file, csv, or tab-delimited file. This file is loaded into a datatable which I convert into a SQLite database table. I’d really prefer to work with strongly typed objects vs datatables so is there a way to easily convert the database table created into a strongly typed class using reflection? The kicker is the file imported into the application will always be different, (ie. different columns) so I can’t really hardcode any strongly typed objects, they are always going to have to be generated on the fly.
Share
Ryan already asked the right question and i can also only aggree that the only benefit of a strongly typed class is at design or compile time, but not at run-time.
Maybe you want after creating your SQLlite tables built up some strong type classes in another application that uses this table.
In that case you could probably take a look into T4 – Text Template Transformation Toolkit, cause it is able to create strong type classes out of a query, so that you are able to use these classes at compile-time for further applications.
But before you start using it, you should know that T4 is one of the best kept Visual Studio secrets. 😉