本文整理汇总了C#中System.Data.SqlTypes.SqlString类的典型用法代码示例。如果您正苦于以下问题:C# SqlString类的具体用法?C# SqlString怎么用?C# SqlString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlString类属于System.Data.SqlTypes命名空间,在下文中一共展示了SqlString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetReady
public void GetReady()
{
Test1 = new SqlString ("First TestString");
Test2 = new SqlString ("This is just a test SqlString");
Test3 = new SqlString ("This is just a test SqlString");
Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-AU");
}
示例2: FormatE_FillRow
public static void FormatE_FillRow(
object inputObject,
out SqlInt32 lineNumber,
out SqlString programNumber,
out SqlString platformId,
out DateTime transmissionDate,
out DateTime? locationDate,
out float? latitude,
out float? longitude,
out float? altitude,
out char? locationClass,
out Byte[] message)
{
var transmission = (ArgosTransmission) inputObject;
lineNumber = transmission.LineNumber;
programNumber = transmission.ProgramId;
platformId = transmission.PlatformId;
transmissionDate = transmission.DateTime;
locationDate = transmission.Location == null ? (DateTime?) null : transmission.Location.DateTime;
latitude = transmission.Location == null ? (float?) null : transmission.Location.Latitude;
longitude = transmission.Location == null ? (float?)null : transmission.Location.Longitude;
altitude = transmission.Location == null ? (float?)null : transmission.Location.Altitude;
locationClass = transmission.Location == null ? (char?)null : transmission.Location.Class;
message = transmission.Message;
}
示例3: cArticle
public cArticle(SqlString artName, SqlString artField, SqlString artMag, SqlDateTime artDate)
{
strName = artName;
strField = artField;
strMagazine = artMag;
dtmDate = artDate;
}
示例4: AddContainerACL
public static void AddContainerACL(
SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
SqlString containerName,
SqlString containerPublicReadAccess,
SqlString accessPolicyId,
SqlDateTime start, SqlDateTime expiry,
SqlBoolean canRead,
SqlBoolean canWrite,
SqlBoolean canDeleteBlobs,
SqlBoolean canListBlobs,
SqlGuid LeaseId,
SqlInt32 timeoutSeconds,
SqlGuid xmsclientrequestId)
{
Enumerations.ContainerPublicReadAccess cpraNew;
if(!Enum.TryParse<Enumerations.ContainerPublicReadAccess>(containerPublicReadAccess.Value, out cpraNew))
{
StringBuilder sb = new StringBuilder("\"" + containerPublicReadAccess.Value + "\" is an invalid ContainerPublicReadAccess value. Valid values are: ");
foreach (string s in Enum.GetNames(typeof(Enumerations.ContainerPublicReadAccess)))
sb.Append("\"" + s + "\" ");
throw new ArgumentException(sb.ToString());
}
AzureBlobService abs = new AzureBlobService(accountName.Value, sharedKey.Value, useHTTPS.Value);
Container cont = abs.GetContainer(containerName.Value);
Enumerations.ContainerPublicReadAccess cpra;
SharedAccessSignature.SharedAccessSignatureACL sasACL = cont.GetACL(out cpra,
LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
string strPermissions = "";
if (canRead.IsTrue)
strPermissions += "r";
if (canWrite.IsTrue)
strPermissions += "w";
if (canDeleteBlobs.IsTrue)
strPermissions += "d";
if (canListBlobs.IsTrue)
strPermissions += "l";
SharedAccessSignature.AccessPolicy ap = new SharedAccessSignature.AccessPolicy()
{
Start = start.Value,
Expiry = expiry.Value,
Permission = strPermissions
};
sasACL.SignedIdentifier.Add(new SharedAccessSignature.SignedIdentifier()
{
AccessPolicy = ap,
Id = accessPolicyId.Value
});
cont.UpdateContainerACL(cpraNew, sasACL,
LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
}
示例5: DetermineInDelTest
public void DetermineInDelTest()
{
SqlString indel = new SqlString("30-TCTC 47-T 59+A 74-C ");
SqlInt64 posStart = new SqlInt64(47152571);
IEnumerable resultList = UserDefinedFunctions.DetermineInDel(posStart, indel);
Assert.AreEqual(4, ((ArrayList)resultList).Count);
}
示例6: sendSelectedResultSetToSqlContext
public void sendSelectedResultSetToSqlContext(SqlInt32 resultsetNo, SqlString command)
{
validateResultSetNumber(resultsetNo);
SqlDataReader dataReader = testDatabaseFacade.executeCommand(command);
int ResultsetCount = 0;
if (dataReader.FieldCount > 0)
{
do
{
ResultsetCount++;
if (ResultsetCount == resultsetNo)
{
sendResultsetRecords(dataReader);
break;
}
} while (dataReader.NextResult());
}
dataReader.Close();
if(ResultsetCount < resultsetNo)
{
throw new InvalidResultSetException("Execution returned only " + ResultsetCount.ToString() + " ResultSets. ResultSet [" + resultsetNo.ToString() + "] does not exist.");
}
}
示例7: Match
public static IEnumerable Match(SqlString pattern, SqlString subject)
{
var list = new List<MatchContent>();
var regex = new Regex(pattern.Value);
var match = regex.Match(subject.Value);
var groupNames = regex.GetGroupNames();
var num = 0;
while (match.Success)
{
num++;
var array = groupNames;
foreach (var text in array)
{
list.AddRange(match.Groups[text].Captures
.Cast<Capture>()
.Select(capture =>
new MatchContent
{
MatchNumber = num,
GroupName = text,
CaptureNumber = capture.Index,
Value = capture.Value
}));
}
match = match.NextMatch();
}
return list;
}
示例8: GetReady
public void GetReady()
{
Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en-AU";
Test1 = new SqlString ("First TestString");
Test2 = new SqlString ("This is just a test SqlString");
Test3 = new SqlString ("This is just a test SqlString");
}
示例9: ValNullable
/// <summary>Add or update a value associated with the specified key.</summary>
/// <param name="key">The key of the value to add or update.</param>
/// <param name="value">The value to add or update associated with the specified key.</param>
/// <returns>A fluent SQLNET object.</returns>
public SQLNET ValNullable(SqlString key, object value)
{
Type type;
value = SqlTypeHelper.ConvertToType(value);
// CHECK for key containing type: int? x
if (key.Value.Contains(" "))
{
var split = key.Value.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (split.Length == 1)
{
type = value.GetType();
key = key.Value.Trim();
}
else if (split.Length == 2)
{
type = TypeHelper.GetTypeFromName(split[0]);
key = split[1];
}
else
{
throw new Exception(string.Format(ExceptionMessage.Invalid_ValueKey, key));
}
}
else
{
type = value.GetType();
}
return InternalValue(key, type, value);
}
示例10: Accumulate
public void Accumulate(SqlString value)
{
if (!value.IsNull)
{
builder.Append(value);
}
}
示例11: InternalValue
public SQLNET InternalValue(SqlString keyString, Type type, object value)
{
var key = keyString.Value;
var item = Item;
var sqlnet = this;
SQLNETParallelItem parallelValue;
// CREATE a new SQLNET from the root
if (ValueParallel == 0)
{
sqlnet = new SQLNET {ValueSerializable = ValueSerializable, ValueParallel = item.GetNextCountAndAddParallel()};
parallelValue = item.AddParallelValue(sqlnet.ValueParallel);
}
else
{
parallelValue = item.GetParallelValue(sqlnet.ValueParallel);
}
if (!item.IsCompiled)
{
//parallelValue.ParameterValues[key] = value;
parallelValue.ParameterValues.Add(key, value);
// Try to add type only if it's not compiled yet
item.ParameterTypes.TryAdd(key, type);
}
else
{
// AddOrUpdate value
parallelValue.ParameterValues[key] = value;
}
return sqlnet;
}
示例12: Box
public static object Box(SqlString a)
{
if (a.IsNull)
return null;
else
return a.Value;
}
示例13: String_Distances_Filler
public static void String_Distances_Filler(object distances,
out SqlString fromString, out SqlString toString, out SqlDouble Hamming_Distance,
out SqlDouble Jaccard_Distance, out SqlDouble Jaro_Distance, out SqlDouble Jaro_Winkler_Distance,
out SqlDouble Levenshtein_Distance, out SqlDouble Levenshtein_Distance_Lower_Bound,
out SqlDouble Levenshtein_Distance_Upper_Bound, out SqlDouble Normalized_Levenshtein_Distance,
out SqlDouble Overlap_Coefficient, out SqlDouble Ratcliff_Obershelp_Similarity,
out SqlDouble Sorensen_Dice_Index, out SqlDouble Sorensen_Dice_Distance,
out SqlDouble Tanimoto_Coefficient) {
AllDistanceMetrics adm = (AllDistanceMetrics)distances;
fromString = adm.fromString;
toString = adm.toString;
Hamming_Distance = adm.Hamming_Distance;
Jaccard_Distance = adm.Jaccard_Distance;
Jaro_Distance = adm.Jaro_Distance;
Jaro_Winkler_Distance = adm.Jaro_Winkler_Distance;
Levenshtein_Distance = adm.Levenshtein_Distance;
Levenshtein_Distance_Lower_Bound = adm.Levenshtein_Distance_Lower_Bound;
Levenshtein_Distance_Upper_Bound = adm.Levenshtein_Distance_Upper_Bound;
Normalized_Levenshtein_Distance = adm.Normalized_Levenshtein_Distance;
Overlap_Coefficient = adm.Overlap_Coefficient;
Ratcliff_Obershelp_Similarity = adm.Ratcliff_Obershelp_Similarity;
Sorensen_Dice_Index = adm.Sorensen_Dice_Index;
Sorensen_Dice_Distance = adm.Sorensen_Dice_Distance;
Tanimoto_Coefficient = adm.Tanimoto_Coefficient;
}
示例14: UpdateIPP
public void UpdateIPP(SqlString nIPPId,SqlInt32 nPaymentId)
{
myRP.NNullIPPId = nIPPId;
myRP.NPaymentID = nPaymentId;
myRP.UpdateAllWnIPP_PaymentIDLogic();
}
示例15: Create
public void Create()
{
// SqlString (String)
SqlString TestString = new SqlString ("Test");
Assert.AreEqual ("Test", TestString.Value, "#A01");
// SqlString (String, int)
TestString = new SqlString ("Test", "en-GB");
Assert.AreEqual ("en-GB", TestString.Name, "#A02");
// SqlString (int, SqlCompareOptions, byte[])
TestString = new SqlString ("en-GB",
SqlCompareOptions.BinarySort|SqlCompareOptions.IgnoreCase,
new byte [2] {123, 221});
Assert.AreEqual ("en-GB", TestString.CompareInfo.Name, "#A03");
// SqlString(string, int, SqlCompareOptions)
TestString = new SqlString ("Test", "en-GB", SqlCompareOptions.IgnoreNonSpace);
Assert.IsTrue (!TestString.IsNull, "#A04");
// SqlString (int, SqlCompareOptions, byte[], int, int)
TestString = new SqlString ("en-GB", SqlCompareOptions.BinarySort, new byte [2] {113, 100}, 0, 2);
Assert.IsTrue (!TestString.IsNull, "#A07");
// SqlString (int, SqlCompareOptions, byte[], int, int, bool)
TestString = new SqlString ("en-GB", SqlCompareOptions.IgnoreCase, new byte [3] {123, 111, 222}, 1, 2);
Assert.IsTrue (!TestString.IsNull, "#A09");
}