thomasm1948
asked on
c# Input array is longer than the number of columns in this table
Hi All,
I have an datatable that is filled from a quickbooks. what i need to do next select the values by class name. when trying this I get "Input array is longer than the number of columns in this table". Below is my code
I am not sure what I am doing wrong
Thank you for your help in advance
I have an datatable that is filled from a quickbooks. what i need to do next select the values by class name. when trying this I get "Input array is longer than the number of columns in this table". Below is my code
string selectrows = "ClassName = " + "'" + bobArray[i].ToString() + "'";
for (int j = 0; j < dt_tr_classMerge.Columns.Count ; j++)
{
string colName = dt_tr_classMerge.Columns[j].ColumnName;
dt_tr_class.Columns.Add(colName, typeof(String));
}
DataRow[] results = dt_tr_classMerge.Select(selectrows);
dt_tr_class.Rows.Add(results);
//dt_tr_classMerge.Select(selectrows);
//
//dt_tr_class.Rows.Add(dt_tr_classMerge.Select(selectrows));
SaveReportDataToFile(dt_tr_class, tr_class, rp_path);
I am not sure what I am doing wrong
Thank you for your help in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I figured it out
/gustav