I am trying to create a list variable and set its type later.
So, Is something like this possible?
List<IList> lst;
switch (file.FileName.ToLower())
{
case "datsal.xls":
lst = new List<MyType1>();
break;
case "logorg.xls":
lst = new List<MyType2>();
break;
case "datcst.xls":
lst = new List<MyType3>();
break;
}
So, Is something like this possible?
List<IList> lst;
switch (file.FileName.ToLower())
{
case "datsal.xls":
lst = new List<MyType1>();
break;
case "logorg.xls":
lst = new List<MyType2>();
break;
case "datcst.xls":
lst = new List<MyType3>();
break;
}