• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SqlTypes.SqlString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Data.SqlTypes.SqlString的典型用法代码示例。如果您正苦于以下问题:C# SqlString类的具体用法?C# SqlString怎么用?C# SqlString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SqlString类属于System.Data.SqlTypes命名空间,在下文中一共展示了SqlString类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: BelboonResults

        public BelboonResults(SqlString eventdate,
				SqlString programmid,
		SqlString programmname,
		  SqlString eventcurrency,
		 SqlString clicks,
		 SqlString clickcommission,
		 SqlString views,
		 SqlString viewcommission,
		 SqlString leads,
		 SqlString leadcommission,
		 SqlString sales,
		 SqlString salecommission,
		 SqlString totalcommission,
		SqlString clickthroughrate,
		 SqlString leadconversionrate,
		 SqlString saleconversionrate)
        {
            this.eventdate = eventdate;
            this.programmid = programmid;
            this.programmname = programmname;
            this.eventcurrency = eventcurrency;
            this.clicks = clicks;
            this.clickcommission = clickcommission;
            this.views = views;
            this.viewcommission = viewcommission;
            this.leads = leads;
            this.leadcommission = leadcommission;
            this.sales = sales;
            this.salecommission = salecommission;
            this.totalcommission = totalcommission;
            this.leadconversionrate = leadconversionrate;
            this.clickthroughrate = clickthroughrate;
            this.saleconversionrate = saleconversionrate;
        }
开发者ID:joserodriguezdtm,项目名称:ZANOX,代码行数:34,代码来源:Form1.cs


示例17: ExecQuery

        public static SqlXml ExecQuery(SqlString Sql, SqlXml Options, SqlXml Input)
        {
            var XOutput = new XDocument(new XElement("root"));

            try
            {
                using (var q = new SqlCommand())
                {
                    q.Connection = new SqlConnection("context connection=true");
                    q.CommandType = CommandType.Text;

                    q.CommandText = Sql.Value;
                    q.InitOptions(Options.Value);
                    q.Parameters.SetInput(Input.Value);

                    q.Connection.Open();
                    var Result = q.ExecuteXmlReader();
                    if (Result.Read())
                        XOutput.Root.Element("content").Add(
                            XElement.Load(Result, LoadOptions.None));
                    q.Connection.Close();
                }
            }
            catch (Exception ex)
            {
                XOutput.Root.Add(ex.ExceptionSerialize());
            }

            return new SqlXml(XOutput.CreateReader());
        }
开发者ID:PeletonSoft,项目名称:Assemblies,代码行数:30,代码来源:ExternalXML.cs


示例18: GetSkyline

 public static void GetSkyline(SqlString strQuery, SqlString strOperators, SqlInt32 numberOfRecords, SqlInt32 sortType, SqlInt32 upToLevel)
 {
     SPMultipleSkylineBNLLevel skyline = new SPMultipleSkylineBNLLevel();
     string[] additionalParameters = new string[5];
     additionalParameters[4] = upToLevel.ToString();
     skyline.GetSkylineTable(strQuery.ToString(), strOperators.ToString(), numberOfRecords.Value, false, Helper.CnnStringSqlclr, Helper.ProviderClr, additionalParameters, sortType.Value, true);
 }
开发者ID:Bulld0zzer,项目名称:prefSQL,代码行数:7,代码来源:SPMultipleSkylineBNLLevel.cs


示例19: ExecScript

        public static SqlXml ExecScript(SqlString Sql, SqlXml Options, SqlXml Input)
        {
            var XOutput = new XDocument(
                new XElement("root",
                    new XElement("content")));

            try
            {
                using (var q = new SqlCommand())
                {
                    q.Connection = new SqlConnection("context connection=true");
                    q.CommandType = CommandType.Text;

                    q.CommandText = Sql.Value;
                    q.InitOptions(Options.Value);
                    q.Parameters.SetInput(Input.Value);

                    q.Connection.Open();
                    q.ExecuteNonQuery();
                    XOutput.Root.Add(q.Parameters.GetOutput());
                    q.Connection.Close();
                }
            }
            catch (Exception ex)
            {
                XOutput.Root.Add(ex.ExceptionSerialize());
            }

            return new SqlXml(XOutput.CreateReader());
        }
开发者ID:PeletonSoft,项目名称:Assemblies,代码行数:30,代码来源:ExternalXML.cs


示例20: ParallelBlock

        /// <summary>
        /// Initializes parallel block during the call to <see cref="Parallel_Declare"/> stored procedure
        /// </summary>
        /// <param name="name"></param>
        public ParallelBlock(SqlString name)
        {
            string dbName = null;
            _startedThreads = new List<string>();
            _name = name.IsNull ? string.Empty : name.Value;

            //let's get current server name
            SqlConnectionStringBuilder connStrBuilder = new SqlConnectionStringBuilder();
            connStrBuilder.ContextConnection = true;
            using (SqlConnection conn = new SqlConnection(connStrBuilder.ConnectionString))
            {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand())
                {
                    cmd.CommandText = "SELECT DB_NAME()";
                    cmd.CommandType = CommandType.Text;
                    dbName = (string)cmd.ExecuteScalar();
                }
            }
            //build connection string, which will be used to execute sql in threads
            connStrBuilder = new SqlConnectionStringBuilder();
            connStrBuilder.DataSource = "(local)";
            connStrBuilder.InitialCatalog = dbName;
            connStrBuilder.IntegratedSecurity = true;
            connStrBuilder.MultipleActiveResultSets = false;
            connStrBuilder.Pooling = true;

            connStrBuilder.MaxPoolSize = 30;
            connStrBuilder.ConnectTimeout = 30;
            //Enlisting will be done when connecting to server if transaction is enabled
            connStrBuilder.Enlist = false;
            _connectionString = connStrBuilder.ConnectionString;

            _threads = new List<ThreadSql>();
        }
开发者ID:WrongDog,项目名称:MyTest,代码行数:39,代码来源:ParallelBlock.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SqlTypes.SqlXml类代码示例发布时间:2022-05-26
下一篇:
C# SqlTypes.SqlSingle类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap