Having a bit of trouble following VB.NET to C# conversion. It was an automatic conversion. I'm currently taking a crash course in C# so there's a lot I'm unsure on.
The below code essentially takes a table apptableoriginal and copies it apptablecopy. However it first checks that ICON exists in original table. If not, sets it to an empty string.
However where row is referenced (e.g. row("ICON"), row("NAME')) I'm getting a Method Name Expected error. From searching online I though it might be a case of replacing the round brackets with square brackets, but this doesn't seem to be the case.
apptablecopy = new DataTable();
apptablecopy.Columns.Add("ICON", typeof(string));
apptablecopy.Columns.Add("NAME", typeof(string));
foreach (var row in apptableoriginal.Rows)
{
string icon;
try
{
icon = row("ICON");
}
catch
{
icon = "";
}
apptablecopy.Rows.Add(icon, row("NAME"));
}