当前位置: 首页>>代码示例>>C#>>正文


C# SqlTypes.SqlString类代码示例

本文整理汇总了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");
 }
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:SqlStringTest.cs

示例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;
 }
开发者ID:regan-sarwas,项目名称:AnimalMovement,代码行数:25,代码来源:CollarFileInfo.cs

示例3: cArticle

 public cArticle(SqlString artName, SqlString artField, SqlString artMag, SqlDateTime artDate)
 {
     strName = artName;
     strField = artField;
     strMagazine = artMag;
     dtmDate = artDate;
 }
开发者ID:hoaian89,项目名称:DAA,代码行数:7,代码来源:advControl.cs

示例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);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:60,代码来源:AzureBlob.cs

示例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);
 }
开发者ID:szalaigj,项目名称:LoaderToolkit,代码行数:7,代码来源:UserDefinedFunctionsTest.cs

示例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.");
            }
        }
开发者ID:DFineNormal,项目名称:tSQLt,代码行数:26,代码来源:ResultSetFilter.cs

示例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;
 }
开发者ID:PeletonSoft,项目名称:Assemblies,代码行数:28,代码来源:RegExExtentionClass.cs

示例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");
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:7,代码来源:SqlStringTest.cs

示例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);
        }
开发者ID:zzzprojects,项目名称:Eval-SQL.NET,代码行数:36,代码来源:ValNullable.cs

示例10: Accumulate

 public void Accumulate(SqlString value)
 {
     if (!value.IsNull)
     {
         builder.Append(value);
     }
 }
开发者ID:NK-Hertz,项目名称:Telerik-Academy-2015,代码行数:7,代码来源:StrConcat.cs

示例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;
        }
开发者ID:zzzprojects,项目名称:Eval-SQL.NET,代码行数:35,代码来源:InternalValue.cs

示例12: Box

 public static object Box(SqlString a)
 {
     if (a.IsNull)
         return null;
     else
         return a.Value;
 }
开发者ID:valery-shinkevich,项目名称:sooda,代码行数:7,代码来源:SoodaNullable.cs

示例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;
        }
开发者ID:wbuchanan,项目名称:whyWontSQLServerImplementRegexNatively,代码行数:26,代码来源:AllDistanceMetrics.cs

示例14: UpdateIPP

        public void UpdateIPP(SqlString nIPPId,SqlInt32 nPaymentId)
        {
            myRP.NNullIPPId = nIPPId;
            myRP.NPaymentID = nPaymentId;

            myRP.UpdateAllWnIPP_PaymentIDLogic();
        }
开发者ID:kimykunjun,项目名称:test,代码行数:7,代码来源:ReceiptPayment.cs

示例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");
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:28,代码来源:SqlStringTest.cs


注:本文中的System.Data.SqlTypes.SqlString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。