M
Mike
Hi,
I am using an enum to map to certain columns instead of using the string
name. When I use the enum as the indexer in a datarow it forces me to cast
it into an int. Shouldn't this be automatic at design time? See code
below:
private enum DataIndexer
{
OrderID,
SerialNumber
};
orderID = (string)currentRow[(int)DataIndexer.OrderID];
serialNumber = (string)currentRow[(int)DataIndexer.SerialNumber];
Why not this:
rderID = (string)currentRow[DataIndexer.OrderID];
serialNumber = (string)currentRow[DataIndexer.SerialNumber];
Thanks
I am using an enum to map to certain columns instead of using the string
name. When I use the enum as the indexer in a datarow it forces me to cast
it into an int. Shouldn't this be automatic at design time? See code
below:
private enum DataIndexer
{
OrderID,
SerialNumber
};
orderID = (string)currentRow[(int)DataIndexer.OrderID];
serialNumber = (string)currentRow[(int)DataIndexer.SerialNumber];
Why not this:
rderID = (string)currentRow[DataIndexer.OrderID];
serialNumber = (string)currentRow[DataIndexer.SerialNumber];
Thanks