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

C# SqlTypes.SqlBoolean类代码示例

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

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



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

示例1: And

		public void And() {

			SqlBoolean SqlTrue2 = new SqlBoolean(true);
			SqlBoolean SqlFalse2 = new SqlBoolean(false);

			// One result value
			SqlBoolean sqlResult;

			// true && false
			sqlResult = SqlBoolean.And(SqlTrue, SqlFalse);
			Assert.IsTrue (!sqlResult.Value, "And method does not work correctly (true && false)");
			sqlResult = SqlBoolean.And(SqlFalse, SqlTrue);
			Assert.IsTrue (!sqlResult.Value, "And method does not work correctly (false && true)");

			// true && true
			sqlResult = SqlBoolean.And(SqlTrue, SqlTrue2);
			Assert.IsTrue (sqlResult.Value, "And method does not work correctly (true && true)");

			sqlResult = SqlBoolean.And(SqlTrue, SqlTrue);
			Assert.IsTrue (sqlResult.Value, "And method does not work correctly (true && true2)");

			// false && false
			sqlResult = SqlBoolean.And(SqlFalse, SqlFalse2);
			Assert.IsTrue (!sqlResult.Value, "And method does not work correctly (false && false)");
			sqlResult = SqlBoolean.And(SqlFalse, SqlFalse);
			Assert.IsTrue (!sqlResult.Value, "And method does not work correctly (false && false2)");

		}
开发者ID:nlhepler,项目名称:mono,代码行数:28,代码来源:SqlBooleanTest.cs


示例2: GetReady

		public void GetReady() {
			
			Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
			SqlTrue = new SqlBoolean(true);
			SqlFalse = new SqlBoolean(false);

		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:SqlBooleanTest.cs


示例3: And

        public void And()
        {
            SqlBoolean SqlTrue2 = new SqlBoolean(true);
            SqlBoolean SqlFalse2 = new SqlBoolean(false);

            // One result value
            SqlBoolean sqlResult;

            // true && false
            sqlResult = SqlBoolean.And(_sqlTrue, _sqlFalse);
            Assert.True(!sqlResult.Value);
            sqlResult = SqlBoolean.And(_sqlFalse, _sqlTrue);
            Assert.True(!sqlResult.Value);

            // true && true
            sqlResult = SqlBoolean.And(_sqlTrue, SqlTrue2);
            Assert.True(sqlResult.Value);

            sqlResult = SqlBoolean.And(_sqlTrue, _sqlTrue);
            Assert.True(sqlResult.Value);

            // false && false
            sqlResult = SqlBoolean.And(_sqlFalse, SqlFalse2);
            Assert.True(!sqlResult.Value);
            sqlResult = SqlBoolean.And(_sqlFalse, _sqlFalse);
            Assert.True(!sqlResult.Value);
        }
开发者ID:dotnet,项目名称:corefx,代码行数:27,代码来源:SqlBooleanTest.cs


示例4: SmiQueryMetaData

 internal SmiQueryMetaData(SqlDbType dbType, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, Type userDefinedType, string udtAssemblyQualifiedName, bool isMultiValued, IList<SmiExtendedMetaData> fieldMetaData, SmiMetaDataPropertyCollection extendedProperties, string name, string typeSpecificNamePart1, string typeSpecificNamePart2, string typeSpecificNamePart3, bool allowsDBNull, string serverName, string catalogName, string schemaName, string tableName, string columnName, SqlBoolean isKey, bool isIdentity, bool isColumnSet, bool isReadOnly, SqlBoolean isExpression, SqlBoolean isAliased, SqlBoolean isHidden) : base(dbType, maxLength, precision, scale, localeId, compareOptions, userDefinedType, udtAssemblyQualifiedName, isMultiValued, fieldMetaData, extendedProperties, name, typeSpecificNamePart1, typeSpecificNamePart2, typeSpecificNamePart3, allowsDBNull, serverName, catalogName, schemaName, tableName, columnName, isKey, isIdentity, isColumnSet)
 {
     this._isReadOnly = isReadOnly;
     this._isExpression = isExpression;
     this._isAliased = isAliased;
     this._isHidden = isHidden;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:SmiQueryMetaData.cs


示例5: 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


示例6: ChangeContainerPublicAccessMethod

        public static void ChangeContainerPublicAccessMethod(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString containerPublicReadAccess,            
            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);

            cont.UpdateContainerACL(cpraNew, sasACL,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:31,代码来源:AzureBlob.cs


示例7: GetReady

		public void GetReady() {
			
			Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en-US";
			SqlTrue = new SqlBoolean(true);
			SqlFalse = new SqlBoolean(false);

		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:7,代码来源:SqlBooleanTest.cs


示例8: GetSkyline

        public static void GetSkyline(SqlString strQuery, SqlString strOperators, SqlInt32 numberOfRecords,
            SqlInt32 sortType, SqlInt32 count, SqlInt32 dimension, SqlString algorithm, SqlBoolean hasIncomparable)
        {
            try
            {
                Type strategyType = Type.GetType("prefSQL.SQLSkyline." + algorithm.ToString());

                if (!typeof (SkylineStrategy).IsAssignableFrom(strategyType))
                {
                    throw new Exception("passed algorithm is not of type SkylineStrategy.");
                }

                var strategy = (SkylineStrategy) Activator.CreateInstance(strategyType);

                strategy.Provider = Helper.ProviderClr;
                strategy.ConnectionString = Helper.CnnStringSqlclr;
                strategy.RecordAmountLimit = numberOfRecords.Value;
                strategy.HasIncomparablePreferences = hasIncomparable.Value;
                strategy.SortType = sortType.Value;

                var skylineSample = new SkylineSampling
                {
                    SubsetCount = count.Value,
                    SubsetDimension = dimension.Value,
                    SelectedStrategy = strategy
                };

                DataTable dataTableReturn = skylineSample.GetSkylineTable(strQuery.ToString(), strOperators.ToString());
                SqlDataRecord dataRecordTemplate = skylineSample.DataRecordTemplateForStoredProcedure;

                //throw new Exception(dataTableReturn.Rows[0].Table.Columns.Count.ToString());

                if (SqlContext.Pipe != null)
                {
                    SqlContext.Pipe.SendResultsStart(dataRecordTemplate);

                    foreach (DataRow recSkyline in dataTableReturn.Rows)
                    {
                        for (var i = 0; i < recSkyline.Table.Columns.Count; i++)
                        {
                            dataRecordTemplate.SetValue(i, recSkyline[i]);
                        }
                        SqlContext.Pipe.SendResultsRow(dataRecordTemplate);
                    }
                    SqlContext.Pipe.SendResultsEnd();
                }
            }
            catch (Exception ex)
            {
                //Pack Errormessage in a SQL and return the result
                var strError = "Error in prefSQL_SkylineSampling: ";
                strError += ex.Message;

                if (SqlContext.Pipe != null)
                {
                    SqlContext.Pipe.Send(strError);
                }
            }
        }
开发者ID:Bulld0zzer,项目名称:prefSQL,代码行数:59,代码来源:SPSkylineSampling.cs


示例9: CreateTable

 public static void CreateTable(
     SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
     SqlString tableName,
     SqlString xmsclientrequestId)
 {
     ITPCfSQL.Azure.AzureTableService ats = new AzureTableService(accountName.Value, sharedKey.Value, useHTTPS.Value);
     ats.CreateTable(tableName.Value, xmsclientrequestId != null ? xmsclientrequestId.Value : null);
 }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:8,代码来源:Table.cs


示例10: AddInputEndpointToPersistentVM

        public static void AddInputEndpointToPersistentVM(
            SqlString certificateThumbprint,
            SqlGuid sgSubscriptionId,
            SqlString serviceName,
            SqlString deploymentSlots,
            SqlString vmName,
            SqlString EndpointName,
            SqlInt32 LocalPort,
            SqlBoolean EnableDirectServerReturn,
            SqlInt32 Port,
            SqlString Protocol,
            SqlString Vip,
            SqlBoolean fBlocking)
        {
            X509Certificate2 certificate = RetrieveCertificateInStore(certificateThumbprint.Value);
            Azure.Management.Deployment result = Azure.Internal.Management.GetDeployments(
                certificate,
                sgSubscriptionId.Value,
                serviceName.Value,
                deploymentSlots.Value);

            var vmToAdd = (ITPCfSQL.Azure.Management.PersistentVMRole)result.RoleList.FirstOrDefault(item => item.RoleName.Equals(vmName.Value, StringComparison.InvariantCultureIgnoreCase));

            if (vmToAdd == null)
                throw new ArgumentException("No PersistentVMRole with name " + vmName.Value + " found in sgSubscriptionId = " +
                    sgSubscriptionId.Value + ", serviceName = " + serviceName.Value + ", deploymentSlots = "
                    + deploymentSlots.Value + ".");

            ITPCfSQL.Azure.Management.DeploymentRoleConfigurationSetsConfigurationSetInputEndpoint[] driiesTemp = new
                    ITPCfSQL.Azure.Management.DeploymentRoleConfigurationSetsConfigurationSetInputEndpoint[vmToAdd.ConfigurationSets.ConfigurationSet.InputEndpoints.Length + 1];

            Array.Copy(vmToAdd.ConfigurationSets.ConfigurationSet.InputEndpoints, driiesTemp, vmToAdd.ConfigurationSets.ConfigurationSet.InputEndpoints.Length);

            driiesTemp[driiesTemp.Length - 1] = new ITPCfSQL.Azure.Management.DeploymentRoleConfigurationSetsConfigurationSetInputEndpoint()
            {
                Name = EndpointName.Value,
                LocalPort = LocalPort.Value,
                EnableDirectServerReturn = EnableDirectServerReturn.Value,
                Port = Port.Value,
                Protocol = Protocol.Value,
                Vip = Vip.Value
            };

            vmToAdd.ConfigurationSets.ConfigurationSet.InputEndpoints = driiesTemp;

            var output = ITPCfSQL.Azure.Internal.Management.UpdatePersistentVMRole(
                certificate,
                sgSubscriptionId.Value,
                serviceName.Value,
                result.Name,
                vmToAdd);

            PushOperationStatus(
                certificate,
                sgSubscriptionId.Value,
                new Guid(output[ITPCfSQL.Azure.Internal.Constants.HEADER_REQUEST_ID]),
                fBlocking.IsNull ? false : fBlocking.Value);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:58,代码来源:Management.cs


示例11: DropTable

 public static void DropTable(
     SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
     SqlString tableName,
     SqlGuid xmsclientrequestId)
 {
     ITPCfSQL.Azure.AzureTableService ats = new AzureTableService(accountName.Value, sharedKey.Value, useHTTPS.Value);
     ats.GetTable(tableName.Value).Drop(
         xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
 }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:9,代码来源:Table.cs


示例12: GetRanking

 public static void GetRanking(SqlString strQuery, SqlString strSelectExtremas, SqlInt32 numberOfRecords, SqlString strRankingWeights, SqlString strRankingExpressions, SqlBoolean showInternalAttr, SqlString strColumnNames)
 {
     SPRanking ranking = new SPRanking();
     ranking.Provider = Helper.ProviderClr;
     ranking.ConnectionString = Helper.CnnStringSqlclr;
     ranking.RecordAmountLimit = numberOfRecords.Value;
     ranking.ShowInternalAttributes = showInternalAttr.Value;
     ranking.GetRankingTable(strQuery.ToString(), false, strSelectExtremas.ToString(), strRankingWeights.ToString(), strRankingExpressions.ToString(), strColumnNames.ToString());
 }
开发者ID:Bulld0zzer,项目名称:prefSQL,代码行数:9,代码来源:SPRanking.cs


示例13: FillRowFromExtraAndMissingNuc

    public static void FillRowFromExtraAndMissingNuc(object tableTypeObject, out SqlInt64 inDelStartPos, out SqlBoolean inDel, out SqlInt32 chainLen, out SqlString nucChain)
    {
        var tableType = (InDelRow)tableTypeObject;

        inDelStartPos = tableType.InDelStartPos;
        inDel = tableType.InDel;
        chainLen = tableType.ChainLen;
        nucChain = tableType.NucChain;
    }
开发者ID:szalaigj,项目名称:LoaderToolkit,代码行数:9,代码来源:DetermineInDel.cs


示例14: Create

        public void Create()
        {
            SqlBoolean SqlTrue2 = new SqlBoolean(1);
            SqlBoolean SqlFalse2 = new SqlBoolean(0);

            Assert.True(_sqlTrue.Value);
            Assert.True(SqlTrue2.Value);
            Assert.True(!_sqlFalse.Value);
            Assert.True(!SqlFalse2.Value);
        }
开发者ID:dotnet,项目名称:corefx,代码行数:10,代码来源:SqlBooleanTest.cs


示例15: CreateQueue

 public static void CreateQueue(
     SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
     SqlString queueName,
     SqlInt32 timeoutSeconds,
     SqlGuid xmsclientrequestId)
 {
     ITPCfSQL.Azure.AzureQueueService aqs = new AzureQueueService(accountName.Value, sharedKey.Value, useHTTPS.Value);
     aqs.CreateQueue(queueName.Value, timeoutSeconds.Value,
         xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
 }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:10,代码来源:Queue.cs


示例16: Create

		public void Create ()
			{
				SqlBoolean SqlTrue2 = new SqlBoolean(1);
				SqlBoolean SqlFalse2 = new SqlBoolean(0);

				Assert("Creation of SqlBoolean failed", SqlTrue.Value);
				Assert("Creation of SqlBoolean failed", SqlTrue2.Value);
				Assert("Creation of SqlBoolean failed", !SqlFalse.Value);
				Assert("Creation of SqlBoolean failed", !SqlFalse2.Value);

			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:11,代码来源:SqlBooleanTest.cs


示例17: Create

		public void Create ()
		{
			SqlBoolean SqlTrue2 = new SqlBoolean(1);
			SqlBoolean SqlFalse2 = new SqlBoolean(0);

			Assert.IsTrue (SqlTrue.Value, "Creation of SqlBoolean failed");
			Assert.IsTrue (SqlTrue2.Value, "Creation of SqlBoolean failed");
			Assert.IsTrue (!SqlFalse.Value, "Creation of SqlBoolean failed");
			Assert.IsTrue (!SqlFalse2.Value, "Creation of SqlBoolean failed");

		}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:SqlBooleanTest.cs


示例18: RegExMatches

        public static IEnumerable RegExMatches(SqlString input, SqlString pattern, SqlBoolean ignoreCase)
        {
            //If either input is NULL, return NULL
            if (input.IsNull || pattern.IsNull)
            {
                return null;
            }

            //Execute the regular expression and return the result
            return Regex.Matches(input.Value, pattern.Value, ignoreCase.Value ? RegexOptions.IgnoreCase : RegexOptions.None);
        }
开发者ID:leesolutions,项目名称:sql-singularize-pluralize,代码行数:11,代码来源:SqlRegEx.cs


示例19: RegExReplace

        public static SqlString RegExReplace(SqlString input, SqlString pattern, SqlString replacement, SqlBoolean ignoreCase)
        {
            //If either input is NULL, return NULL
            if (input.IsNull || pattern.IsNull)
            {
                return SqlString.Null;
            }

            //Execute the regular expression and return the result
            return new SqlString(Regex.Replace(input.Value, pattern.Value, replacement.Value, ignoreCase.Value ? RegexOptions.IgnoreCase : RegexOptions.None));
        }
开发者ID:leesolutions,项目名称:sql-singularize-pluralize,代码行数:11,代码来源:SqlRegEx.cs


示例20: DeleteEntity

 public static void DeleteEntity(
     SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
     SqlString tableName,
     SqlString partitionKey,
     SqlString rowKey,
     SqlString xmsclientrequestId)
 {
     ITPCfSQL.Azure.AzureTableService ats = new AzureTableService(accountName.Value, sharedKey.Value, useHTTPS.Value);
     ITPCfSQL.Azure.Table table = ats.GetTable(tableName.Value);
     table.Delete(new ITPCfSQL.Azure.TableEntity() { RowKey = rowKey.Value, PartitionKey = partitionKey.Value, TimeStamp = DateTime.Now },
         (xmsclientrequestId != null ? xmsclientrequestId.Value : null));
 }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:12,代码来源:Table.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# SqlTypes.SqlByte类代码示例发布时间:2022-05-26
下一篇:
C# SqlTypes.SqlBinary类代码示例发布时间: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