本文整理汇总了C#中SqlString类的典型用法代码示例。如果您正苦于以下问题:C# SqlString类的具体用法?C# SqlString怎么用?C# SqlString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlString类属于命名空间,在下文中一共展示了SqlString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegExpSearch
public static SqlString RegExpSearch(SqlString source, [SqlFacet(MaxSize = 4000)] SqlString pattern)
{
if (source.IsNull || pattern.IsNull)
return SqlString.Null;
return Regex.Match(source.Value, pattern.Value).Value;
}
示例2: IsNucX
public static SqlInt32 IsNucX(SqlInt64 posStart, SqlString misMNuc, SqlInt64 refPos, SqlString refNuc, SqlString countNuc)
{
SqlInt32 result;
Dictionary<long, string> mutationPositions = new Dictionary<long, string>();
string mutationPattern = @"[0-9]+ [ACGTN]+";
MatchCollection matches = Regex.Matches(misMNuc.Value, mutationPattern);
foreach (Match match in matches)
{
var foundMutation = match.Value;
string[] foundMutParts = foundMutation.Split(' ');
long mutStartPos = posStart.Value + Int32.Parse(foundMutParts[0]);
var mutNuc = foundMutParts[1];
mutationPositions.Add(mutStartPos, mutNuc);
}
string mutValue;
if (mutationPositions.TryGetValue(refPos.Value, out mutValue))
{
result = new SqlInt32(countNuc.Value.Equals(mutValue) ? 1 : 0);
}
else
{
result = new SqlInt32(countNuc.Value.Equals(refNuc.Value) ? 1 : 0);
}
return result;
}
示例3: LookupText
public static SqlString LookupText(SqlString param, SqlString lookupValues)
{
var found = LookupValue(param, lookupValues);
return !String.IsNullOrWhiteSpace(found)
? new SqlString(found, param.LCID)
: SqlString.Null;
}
示例4: RegexGroup
public static SqlChars RegexGroup( SqlChars input, SqlString pattern, SqlString name )
{
Regex regex = new Regex( pattern.Value, Options );
Match match = regex.Match( new string( input.Value ) );
return match.Success ?
new SqlChars( match.Groups[name.Value].Value ) : SqlChars.Null;
}
示例5: CompStrings
public CompStrings(SqlString from, SqlString to, SqlString replace, SqlString tolerance, SqlString comp) {
this.from = from.ToString();
this.to = to.ToString();
this.replace = replace.ToString();
this.tolerance = tolerance.ToString();
this.comp = comp.ToString();
}
示例6: DualFillRow
private static void DualFillRow(Object obj, ref SqlString item)
{
if (obj != null)
{
item = (string)obj;
}
}
示例7: SqlToken
public SqlToken(SqlTokenType tokenType, SqlString sql, int sqlIndex, int length)
{
_tokenType = tokenType;
_sql = sql;
_sqlIndex = sqlIndex;
_length = length;
}
示例8: RegExpCheck
public static SqlBoolean RegExpCheck(SqlString source, [SqlFacet(MaxSize = 4000)] SqlString pattern)
{
if (source.IsNull || pattern.IsNull)
return SqlBoolean.Null;
return Regex.IsMatch(source.Value, pattern.Value);
}
示例9: SampleWSPut
public static void SampleWSPut(SqlString weburl, out SqlString returnval)
{
string url = Convert.ToString(weburl);
string feedData = string.Empty;
try {
HttpWebRequest request = null;
HttpWebResponse response = null;
Stream stream = null;
StreamReader streamReader = null;
request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "PUT"; // you have to change to
//PUT/POST/GET/DELETE based on your scenerio…
request.ContentLength = 0;
response = (HttpWebResponse)request.GetResponse();
stream = response.GetResponseStream();
streamReader = new StreamReader(stream);
feedData = streamReader.ReadToEnd();
response.Close();
stream.Dispose();
streamReader.Dispose();
} catch (Exception ex) {
SqlContext.Pipe.Send(ex.Message.ToString());
}
returnval = feedData;
}
示例10: FillRowFromSequencesAndExtraAndMissingNuc
public static void FillRowFromSequencesAndExtraAndMissingNuc(object tableTypeObject, out SqlString mismatch, out SqlString indel)
{
var tableType = (MismatchInDelRow)tableTypeObject;
mismatch = tableType.Mismatch;
indel = tableType.Indel;
}
示例11: SampleWSPost
public static void SampleWSPost(SqlString weburl, out SqlString returnval)
{
string url = Convert.ToString(weburl);
string feedData = string.Empty;
try {
HttpWebRequest request = null;
HttpWebResponse response = null;
Stream stream = null;
StreamReader streamReader = null;
request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
response = (HttpWebResponse)request.GetResponse();
stream = response.GetResponseStream();
streamReader = new StreamReader(stream);
feedData = streamReader.ReadToEnd();
response.Close();
stream.Dispose();
streamReader.Dispose();
} catch (Exception ex) {
SqlContext.Pipe.Send(ex.Message.ToString());
}
returnval = feedData;
}
示例12: Or3
public static SqlString Or3(
SqlString text0,
SqlString text1,
SqlString text2)
{
return OrSqlString(text0, text1, text2);
}
示例13: ParamDateTimeTemp
public static SqlDateTime ParamDateTimeTemp(SqlXml Xml, SqlString Name)
{
String ValueType;
String Value = GetValueFromXMLAttribute(Xml, Name, out ValueType);
if (Value == null) return new SqlDateTime();
SqlDateTime Result;
try
{
Result = new SqlDateTime(XmlConvert.ToDateTime(Value, XmlDateTimeSerializationMode.RoundtripKind));
}
catch (Exception Error)
{
throw new System.Exception("Error convert Param = \"" + Name.Value.ToString() + "\" Value = \"" + Value.ToString() + "\" to DateTime: " + Error.Message);
}
if (ValueType != null && ValueType != "")
{
// year, month, day, hour, minute, second
switch (ValueType)
{
case "1": return Result.Value.Date.AddDays(1);
default: return Result;
}
}
return Result;
}
示例14: GetParam
public static int GetParam(SqlString s)
{
// 在此处放置代码
Regex _break_comp = new Regex(@"\{\d\}", RegexOptions.Compiled);
return _break_comp.Matches(s.ToString() ).Count;
//return new SqlString("Hello");
}
示例15: String_Compare_Equal
public void String_Compare_Equal()
{
const string s = "Test string in UTF-16 LE";
var sqlString1 = new SqlString(s);
var sqlString2 = new SqlString(s);
Assert.AreEqual(0, sqlString1.CompareTo(sqlString2));
}