using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sdaleo.Systems; namespace Sdaleo.Systems.SQLCE { /// /// SQL CE Custom Validation /// internal static class Validation { /// /// validate SQL CE Table Names /// /// /// public static DBError IsValidTableName(string strTableName) { if (string.IsNullOrEmpty(strTableName)) { return DBError.Create("TableName is null"); } else if (strTableName.Length < 1 || strTableName.Length > 52) // limit Table Name length { return DBError.Create("TableName length is invalid"); } else if (!ValidationConsts.ContainsOnlyLegalChars(strTableName, ValidationConsts.CharSet_AllowedTableNames)) { return DBError.Create("TableName contains illegal characters"); } else { return new DBError(); } } } }