Initial Commit
This commit is contained in:
15
Systems/SQLCE/Internal/ErrorConst.cs
Normal file
15
Systems/SQLCE/Internal/ErrorConst.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Sdaleo.Systems.SQLCE
|
||||
{
|
||||
/// <summary>
|
||||
/// SQL CE Database Error Constants to Use to handle specific Errors
|
||||
/// </summary>
|
||||
internal static class ErrorConst
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
39
Systems/SQLCE/Internal/Validation.cs
Normal file
39
Systems/SQLCE/Internal/Validation.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Sdaleo.Systems;
|
||||
|
||||
namespace Sdaleo.Systems.SQLCE
|
||||
{
|
||||
/// <summary>
|
||||
/// SQL CE Custom Validation
|
||||
/// </summary>
|
||||
internal static class Validation
|
||||
{
|
||||
/// <summary>
|
||||
/// validate SQL CE Table Names
|
||||
/// </summary>
|
||||
/// <param name="strTableName"></param>
|
||||
/// <returns></returns>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user