C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a DataTable with a column as green_dt.Columns.Add("overviews_list", typeof(List<string>));
foreach (DataRow dr in green_dt.Rows)
{
if (dr["overviews_list"] != DBNull.Value)
{
foreach (string family_overview in dr["overviews_list"] * here is the problem)
{
}
}
}
in the above code, * is problem.
The datatype of the column is LIst<string> but no relative methods are shown by Visual Studio like ToString() and so on. And Convert. Method also shows Int32, Int64 and so on but not ToList();
I've also failed to find some solution on internet.
This seems not pretty difficult but lost with busy real life...
Thank you !
Try this fix:
foreach( string family_overview in (List<string>)dr["overviews_list"] )
{
}