I am using a ADO.NET entity data model. I would like to loop through all the database tables and get the column name and row values. I am partially able to achieve this.
Currently I use the code
Object LinqObject = new Table1();
But I would like to use part of code below in which tableName is a string which has the name of the database table. As I have these table names in a list I would like to loop through.
foreach(ExItem tableName in List1)
Object LinqObject = Activator.CreateInstance(tableName, null);
//For each field in the database (or property in Linq object)
foreach (PropertyInfo pi in LinqObject.GetType().GetProperties())
String ColumnName = pi.Name;
I get the error "Could not load file or assembly 'Table1 or one of its dependencies. The system cannot find the file specified." at Object LinqObject = Activator.CreateInstance(tableName, null);
How can I solve this issue