C
Curious
Hi,
I have a class with properties and each property has specific
datatypes.
Is it possible to extract the datatypes of each property found in a
class?
I would like to extract these datatypes so that I can build a dataset
schema structure at runtime.
Is this possible?
public class MyProperties
{
private int age;
private string name;
public int Age
{
get{...}
set{...}
}
public string Name
{
get{...}
set{...}
}
}
DataTable dt = new DataTable();
foreach(Property p in MyProperties)
{
DataColumn dc = new DataColum(p.Name, p.DataType);
dt.Columns.Add(dc);
}
Can someone help me out
Thanks in Advance
I have a class with properties and each property has specific
datatypes.
Is it possible to extract the datatypes of each property found in a
class?
I would like to extract these datatypes so that I can build a dataset
schema structure at runtime.
Is this possible?
public class MyProperties
{
private int age;
private string name;
public int Age
{
get{...}
set{...}
}
public string Name
{
get{...}
set{...}
}
}
DataTable dt = new DataTable();
foreach(Property p in MyProperties)
{
DataColumn dc = new DataColum(p.Name, p.DataType);
dt.Columns.Add(dc);
}
Can someone help me out
Thanks in Advance