[성현모] CPXV2 Init
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SystemX.Net.Platform.Common
|
||||
{
|
||||
public static class DataTableQuery
|
||||
{
|
||||
public static List<DataRow> FindDataRow(DataTable dtTable, string strKeyName, string strFindingValue)
|
||||
{
|
||||
List<DataRow> adrResult = (from dtRow in dtTable.AsEnumerable() where dtRow[strKeyName].ToString() == strFindingValue select dtRow).ToList();
|
||||
|
||||
return adrResult;
|
||||
}
|
||||
|
||||
public static int GetDataRowHandle(DataTable dtTable, string strKeyFieldName, string strComparingValue)
|
||||
{
|
||||
int nIdx = 0;
|
||||
|
||||
foreach (DataRow dtRow in dtTable.AsEnumerable())
|
||||
{
|
||||
if (dtRow[strKeyFieldName].ToString() == strComparingValue)
|
||||
return nIdx;
|
||||
|
||||
nIdx++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user