How can I convert this column value to an integer?
- by Kevin
My C# code looks like this:
myNum = dt.Columns[0];
myNum is an integer and dt is a datatable. The value in column 0 of dt is a string ("12"), but I'd like to convert it to an integer. How can I do this?
I've tried:
myNum = int.Parse(dt.Columns[0]);
...but that doesn't work. Any ideas?