DataColumn.Ordinal is -1 when running my app on one webbserver
-
I have a web application (ASP.NET 2.0) that is published on three servers (all working against one database). When I run the code below I got an ArgumentOutOfRangeException on just one of my webbservers. Very strange… All tips of where to start finding the error source are welcomed. I’m running IIS 6.0 and .NET 2.0. It fells like a IIS configuration of handling exceptions… or?
public static DataRow Process(DataRow source0, DataRow source1, List<ProcessItemHandler> handlers)
{
DataRow target = source0.Table.NewRow();
foreach (DataColumn column in source0.Table.Columns)
{
int n = column.Ordinal;
ProcessItemHandler handler = handlers[n];
…_____________________________ ...and justice for all
-
I have a web application (ASP.NET 2.0) that is published on three servers (all working against one database). When I run the code below I got an ArgumentOutOfRangeException on just one of my webbservers. Very strange… All tips of where to start finding the error source are welcomed. I’m running IIS 6.0 and .NET 2.0. It fells like a IIS configuration of handling exceptions… or?
public static DataRow Process(DataRow source0, DataRow source1, List<ProcessItemHandler> handlers)
{
DataRow target = source0.Table.NewRow();
foreach (DataColumn column in source0.Table.Columns)
{
int n = column.Ordinal;
ProcessItemHandler handler = handlers[n];
…_____________________________ ...and justice for all
At some point your handlers collection doesn't have an item at 'n'. Put some exception handling here and log your error in some fashion to allow you to figure out what the problem is.
-
At some point your handlers collection doesn't have an item at 'n'. Put some exception handling here and log your error in some fashion to allow you to figure out what the problem is.
Found the problem. The handler-array was static and was initialized in two different ways depending on which page that was launched firs after an iisreset. Hopefully the problem is solved.
_____________________________ ...and justice for all