I think first you should try to understand the code.
What you need is
1) to concatenate values together in a chain
2) values with -777 must be replaced with "null" in a chain
You do all things almost good, but you do the check for "-777" in DataRow, if found replacing the original value in DataRow, then again read its value when doing the concatenation. After that it does not work because something wrong with number of columns. On top of all you don't know data types and it runs into multiple errors. This makes debugging difficult and slow.
What I would suggest is make it consistent.
1) You said something about n-1. What happens if all 5 if's are commented out? It sounds that error might be somewhere else and not at the above code. Try e.g. with some test values, e.g. "rowsList.Add(... 1, 2, 3, 4" and see if it works at all.
2) "null" and DBNull are dependent on type of fields - I believe they are not type of string in the database (-777) but for some reasons you use Convert.ToString. Also it is not clear why using string of "null" instead of DBnull.Value is better if it's raised an error. Before going further with data type issues try to e.g. set always some test value, for example, row["MPT11"]="1"
3) As mentioned above there might be no need to work with DataRow. Try simplify it using string variables. For example, as per my previous poststring x; if (row["MPT11"] == -777) x = "null"; else x = row["MPT11"].ToString(); rowsList.Add(... + x + ", " ...
I really hope I catch you in time on this before release.
Thought I better flag this STRAIGHT away.
I have simply set up a new project, imported the plugins through the link to the Plugins subfolder, as ever, but then I get the following 4 additional error messages in Console and cannot even get further with set up:-
Assets/RPGAIO/Scripts/Beta/NewImplementation/RPGController.cs(3223,41): error CS0118: `Assets.Scripts.Beta.NewImplementation.RPGController.NavMeshAgent' is a `property' but a `type' was expected
Assets/RPGAIO/Scripts/Beta/NewImplementation/RPGController.cs(3223,13): error CS0584: Internal compiler error: The method or operation is not implemented.
Assets/RPGAIO/Scripts/Beta/NewImplementation/RPGController.cs(3223,13): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
Assets/RPGAIO/Scripts/Core/Combat/TargetLockHandler.cs(34,55): error CS1061: Type `T' does not contain a definition for `radius' and no extension method `radius' of type `T' could be found. Are you missing an assembly reference?