I want to do something like:
stringBuilder.AppendLine(" globalVar." + reader.GetAttribute(i).Name + " = " + reader[i] + "; //add param ");
Where "reader.GetAttribute(i).Name" is the component that doesn't work. Is there an equivalent method to get the name of an attribute?
Use reader.MoveToAttribute(i)
, then you can use reader.Name
and reader.Value
.