Escape Method (s, maxLength)

Design Pattern Framework 3.5

Design Pattern Framework 3.5 Escape Method (s, maxLength)
Patterns-In-Action! ApplicationDataObjects.AdoNetDbEscape(String, Int32)
Escapes an input string for database processing, that is, surround it with quotes and change any quote in the string to two adjacent quotes (i.e. escape it). Also trims string at a given maximum length. If input string is null or empty a NULL string is returned.
Declaration Syntax
C# Visual Basic
public static string Escape(
	string s,
	int maxLength
)
Public Shared Function Escape ( _
	s As String, _
	maxLength As Integer _
) As String
Parameters
s (String)
Input string.
maxLength (Int32)
Maximum length of output string.
Return Value
Escaped output string.

Assembly: DataObjects (Module: DataObjects) Version: 1.0.0.0 (1.0.0.0)