DataTable DataRow Field method
In Rider for Windows:
I am looping through a DataTable and want to access the Field method of the DataRow.
The error I get in Rider is : "Unable to resolve symbol 'Field'
Snippet of code:
foreach (DataRow row in dataTable.Rows)
{
for (var i = 0; i < dataTable.Columns.Count; i++)
{
var column = dataTable.Columns[i];
switch (column.DataType.ToString())
{
case "System.String":
var strVal = row.Field<string>(i).Trim();
break;
case "System.Int32":
var intVal = row.Field<int>(i);
}
}
This works in Visual Studio.
Any help getting this resolved is appreciated.
// Thom
Please sign in to leave a comment.
Hi Thom!
Thank you for the code snippet. What project type do you use? Are there the same project type in Rider and VS? Also, what is your Rider version?
I was able to reproduce the issue with .Net Framework project. However, it is also reproduced in Visual Studio.