DataRowCollection.Add() :
Add(DatarRow row);Add(params object[] values);
, , Add(params object[] values);, object. , , , , ; , DataRow, , , DataRow[] result columns
dt.Rows.Add(new object[] { "Date", "Time", "a", "Log Level", "Message" });
DataRow[] result = dt.Select("Function ='a'");
foreach (DataRow r in dt.Rows)
{
}
, result 1 ( ).
5 result; 6 5 , .
And the right way to do this is to interatingarray the search results and add a new row for each element of the array; using propertyDataRow.ItemArray
You can try the following, which worked for me:
DataRow[] result = dt.Select("Function ='" + strfunction + "'");
foreach (DataRow r in result)
{
dt.Rows.Add(r.ItemArray);
}
source
share