Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ArrayList<Customer> cust = new ..
- Type elementType = Type.GetType("Customer");
- Type listType = typeof(List<>).MakeGenericType(new Type[] { elementType });
- object list = Activator.CreateInstance(listType);
- Type hai = Type.GetType(classString,true);
- Object o = (Activator.CreateInstance(hai)); //Or you could cast here if you already knew the type somehow
Add Comment
Please, Sign In to add comment