SqlMethods.Like Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether a specific character string matches a specified pattern. This method is currently only supported in LINQ to SQL queries.
Overloads
Like(String, String) |
Determines whether a specific character string matches a specified pattern. This method is currently only supported in LINQ to SQL queries. |
Like(String, String, Char) |
Determines whether a specific character string matches a specified pattern. This method is currently only supported in LINQ to SQL queries. |
Remarks
The SQL Server LIKE
functionality cannot be exposed through translation of existing common language runtime (CLR) and .NET Framework constructs, and is unsupported outside of a LINQ to SQL context. The use of this method outside of LINQ to SQL will always throw an exception of type NotSupportedException.
Like(String, String)
Determines whether a specific character string matches a specified pattern. This method is currently only supported in LINQ to SQL queries.
public:
static bool Like(System::String ^ matchExpression, System::String ^ pattern);
public static bool Like (string matchExpression, string pattern);
static member Like : string * string -> bool
Public Shared Function Like (matchExpression As String, pattern As String) As Boolean
Parameters
- matchExpression
- String
The string to be searched for a match.
- pattern
- String
The pattern, which may include wildcard characters, to match in matchExpression
.
Returns
true
if matchExpression
matches the pattern; otherwise, false
.
Remarks
The SQL Server LIKE
functionality cannot be exposed through translation of existing common language runtime (CLR) and .NET Framework constructs, and is unsupported outside of a LINQ to SQL context. The use of this method outside of LINQ to SQL will always throw an exception of type NotSupportedException.
Applies to
Like(String, String, Char)
Determines whether a specific character string matches a specified pattern. This method is currently only supported in LINQ to SQL queries.
public:
static bool Like(System::String ^ matchExpression, System::String ^ pattern, char escapeCharacter);
public static bool Like (string matchExpression, string pattern, char escapeCharacter);
static member Like : string * string * char -> bool
Public Shared Function Like (matchExpression As String, pattern As String, escapeCharacter As Char) As Boolean
Parameters
- matchExpression
- String
The string to be searched for a match.
- pattern
- String
The pattern, which may include wildcard characters, to match in matchExpression
.
- escapeCharacter
- Char
The character to put in front of a wildcard character to indicate that it should be interpreted as a regular character and not as a wildcard character.
Returns
true
if matchExpression
matches the pattern; otherwise, false
.
Remarks
The SQL Server LIKE
functionality cannot be exposed through translation of existing common language runtime (CLR) and .NET Framework constructs, and is unsupported outside of a LINQ to SQL context. The use of this method outside of LINQ to SQL will always throw an exception of type NotSupportedException.