Exemplo n.º 1
0
        /// <summary>
        /// Takes from a table T a row having same key as R
        /// </summary>
        /// <param name="T"></param>
        /// <param name="R">Row to search</param>
        /// <returns>Row found in T with same key of given Row</returns>
        public static DataRow FindExternalRow(DataTable T, DataRow R)
        {
            string condition = QueryCreator.WHERE_REL_CLAUSE(R, T.PrimaryKey, T.PrimaryKey,
                                                             DataRowVersion.Default, false);

            DataRow [] Found = T.Select(condition);
            if (Found.Length == 0)
            {
                return(null);
            }
            return(Found[0]);
        }