Search code examples
c#typesstring-parsing

Can access the Parse methods for a given type based on an instance of Type in C#?


I'm using a DataTable and assigning columns different types. I have a scenario where I'm receiving String data and I want to parse it based on the column's assigned type, but I can't figure out how to get to the parse methods.

Is is it possible to access the Type instance's parse methods in a generic way?


Solution

  • You're looking for Convert.ChangeType.