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


C# SqlTypes.SqlGuid类代码示例

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


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

示例1: Sales_LicenseKeys_Activations

    public static SqlInt32 Sales_LicenseKeys_Activations(SqlGuid licenseKeyId)
    {
        string sql = "select isnull(count(*),0) from Sales_LicenseKeyActivations where [email protected]";
          SqlCommand cmd = new SqlCommand(sql);
          cmd.Parameters.AddWithValue("@Id", licenseKeyId);

          int count = 0;
          using (SqlConnection con = new SqlConnection("context connection=true"))
          {
               try
               {
                    cmd.Connection = con;
                    con.Open();
                    count = (int)cmd.ExecuteScalar();
               }
               catch (Exception ex)
               {
                    throw ex;
               }
               finally
               {
                    if (con != null)
                         con.Close();
               }
          }
          return new SqlInt32(count);
    }
开发者ID:weavver,项目名称:data,代码行数:27,代码来源:Sales_LicenseKeys.cs

示例2: OrGuid3

 public static SqlGuid OrGuid3(
     SqlGuid value0,
     SqlGuid value1,
     SqlGuid value2)
 {
     return OrSqlGuid(value0, value1, value2);
 }
开发者ID:raziqyork,项目名称:Geeks.SqlUtils,代码行数:7,代码来源:Or.SqlGuid.cs

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

示例4: SetCapacity

 override public void SetCapacity(int capacity) {
     SqlGuid[] newValues = new SqlGuid[capacity];
     if (null != values) {
         Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
     }
     values = newValues;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:SQLGuidStorage.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: Create

        public void Create()
        {
            // SqlGuid (Byte[])
            byte[] b = new byte[16];
            b[0] = 100;
            b[1] = 200;

            try
            {
                SqlGuid Test = new SqlGuid(b);

                // SqlGuid (Guid)
                Guid TestGuid = new Guid(b);
                Test = new SqlGuid(TestGuid);

                // SqlGuid (string)
                Test = new SqlGuid("12345678-1234-1234-1234-123456789012");

                // SqlGuid (int, short, short, byte, byte, byte, byte, byte, byte, byte, byte)
                Test = new SqlGuid(10, 1, 2, 13, 14, 15, 16, 17, 19, 20, 21);
            }
            catch (Exception e)
            {
                Assert.False(true);
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:26,代码来源:SqlGuidTest.cs

示例7: OrGuid4

 public static SqlGuid OrGuid4(
     SqlGuid value0,
     SqlGuid value1,
     SqlGuid value2,
     SqlGuid value3)
 {
     return OrSqlGuid(value0, value1, value2, value3);
 }
开发者ID:raziqyork,项目名称:Geeks.SqlUtils,代码行数:8,代码来源:Or.SqlGuid.cs

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

示例9: OrGuid5

 public static SqlGuid OrGuid5(
     SqlGuid value0,
     SqlGuid value1,
     SqlGuid value2,
     SqlGuid value3,
     SqlGuid value4)
 {
     return OrSqlGuid(value0, value1, value2, value3, value4);
 }
开发者ID:raziqyork,项目名称:Geeks.SqlUtils,代码行数:9,代码来源:Or.SqlGuid.cs

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

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

示例12: CmsFile

 protected CmsFile(Guid fileTypeID)
 {
     this.fileTypeID = fileTypeID;
     this.state = CmsState.Unsaved;
     this.version = 1;
     this.id = Guid.NewGuid();
     this.fileID = id;
     dateCreated = DateTime.Now;
     dateModified = dateCreated;
     this.revisionSourceID = SqlGuid.Null;
 }
开发者ID:sffogg,项目名称:Xenosynth,代码行数:11,代码来源:CmsFile.cs

示例13: CreateQueue_Embedded

        public static void CreateQueue_Embedded(
            SqlString logicalConnectionName,
            SqlString queueName,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            Configuration.EmbeddedConfiguration config = Configuration.EmbeddedConfiguration.GetConfigurationFromEmbeddedFile(logicalConnectionName.Value);

            CreateQueue(config.AccountName, config.SharedKey, config.UseHTTPS,
                queueName, timeoutSeconds, xmsclientrequestId);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:11,代码来源:Queue.cs

示例14: DequeueMessage_Embedded

        public static void DequeueMessage_Embedded(
            SqlString logicalConnectionName,
            SqlString queueName,
            SqlInt32 visibilityTimeoutSeconds, // we won't support peek so we should do it fast
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            Configuration.EmbeddedConfiguration config = Configuration.EmbeddedConfiguration.GetConfigurationFromEmbeddedFile(logicalConnectionName.Value);

            DequeueMessage(config.AccountName, config.SharedKey, config.UseHTTPS,
                queueName, visibilityTimeoutSeconds, timeoutSeconds, xmsclientrequestId);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:12,代码来源:Queue.cs

示例15: AcquireBlobInfiniteLease_Embedded

        public static void AcquireBlobInfiniteLease_Embedded(
            SqlString logicalConnectionName,
            SqlString containerName,
            SqlString blobName,
            SqlGuid proposedLeaseId,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            Configuration.EmbeddedConfiguration config = Configuration.EmbeddedConfiguration.GetConfigurationFromEmbeddedFile(logicalConnectionName.Value);

            AcquireBlobInfiniteLease(
                config.AccountName, config.SharedKey, config.UseHTTPS,
                containerName, blobName,
                proposedLeaseId, timeoutSeconds, xmsclientrequestId);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:15,代码来源:BlobStorage.cs


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