Here is my problem:
I have the function
public static void fillObject(object [] obs, DataTable dt)
{
for (int j = 0; j < dt.Rows.Count; j++)
{
DataRow dr = dt.Rows[j];
fillObject(obs[j], dr);
}
}
obs is an array of some type of class (let say for the example “sheep”) when I debug I get that obs[j] is a null and not an object type of sheep so I need to do something like
obs[j] = new sheep();
any ideas?
If you want to strongly type your solution, you can use generics
You would then call the function like