I'm using C# ASP.NET 4 and SQL Server 2008 R2
I'm getting an object scalar from sql server which is a string containing comma separated values of the form:
7, 12, ... 1, 65
I would like to convert this object into a list?
I thought of the direction:
List<int> myList = new List<int>(new int[] (List)mySqlClass.mySqlQueryReturningAnObject("SELECT CLAUSE");
but this is not going to work.
How do I convert this object into a list?
Full answer:
This answer in use is according to the selected answer (before the update)
List<int> myList = new List<int>(mySqlClass.mySqlQueryReturningAnObject("SELECT CLAUSE").ToString().Split(',').Select(x => Convert.ToInt32(x)).ToList());