I want to check if a (Case-Sensitive) tag exists in a SQL Server 2005 table using LINQtoSQL. Say if the tag "BEYONCE" exists in the tags, then I want me to be able to add "beyonce" or "BeYOnce", but not "BEYONCE" again. Here is the LINQ query I wrote:
From t In Context.Tags Where String.Equals(t.Tag, myTag, StringComparison.Ordinal) = True
But he says that the "Boolean Equals (System.String, System.String, System.StringComparison)" method does not support SQL translation. How can I find a case sensitive tag?
, "blah" "BLAH" . , LinqToSQL, , ... i.e.
String tag = "beYONCE"; IEnumerable result = db.ExecuteQuery(typeof (Int32), " * 1 COLLATE Latin1_General_CS_AS = {0}", );
, "beyonce" , "beYONCE". "beyonce" .
, .
, linqtosql.
ExecuteExpression . , .
, # vb, #. , Tag
IEnumerable<Tag> matches = Context.ExecuteQuery<Tag>( "Select * from Tag where Tag = {0} COLLATE Latin1_General_CS_AS", myTag );
, , vb.net: -)
dim matches as IEnumerable(Of Tag) = Context.ExecuteQuery(Of Tag)( _ "Select * from Tag where Tag = {0} COLLATE Latin1_General_CS_AS", myTag _ )
, Chalkey.
Source: https://habr.com/ru/post/1711435/More articles:Запросы/ответы HTTP HTTP REST - restКритика использования jQuery - javascriptHow to echo text in capital letters? - phpKen Burns effect on iPhone - iphoneGet Repeater Items - c #django-like framework? - javaDjango: по-разному разбивается на страницы на странице - djangoHtml xquery example - htmlquick and easy way to template xml files in python - pythonSQLite query optimization (subquery and join) - optimizationAll Articles