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

C# SqlTypes.SqlGuid类代码示例

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

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



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


示例16: GetName

 public static SqlString GetName(SqlGuid id)
 {
     string val = "";
       SqlConnection connection = new SqlConnection("context connection=true");
       connection.Open();
       GetFieldFromTable(connection, id, "Firstname,LastName", "System_Users", ref val);
       GetFieldFromTable(connection, id, "Name", "Logistics_Organizations", ref val);
       GetFieldFromTable(connection, id, "FirstName,LastName", "HR_Staff", ref val);
       GetFieldFromTable(connection, id, "Name", "Accounting_Accounts", ref val);
       GetFieldFromTable(connection, id, "Memo", "Accounting_LedgerItems", ref val);
       GetFieldFromTable(connection, id, "PrimaryContactNameFirst,PrimaryContactNameLast", "Sales_Orders", ref val);
       GetFieldFromTable(connection, id, "Name", "Logistics_Addresses", ref val);
       GetFieldFromTable(connection, id, "Right(Number, 4) as 'Number'", "Accounting_CreditCards", ref val);
       GetFieldFromTable(connection, id, "SUBSTRING(Memo, 1, 10) as 'Memo', '- ARB Rule' as 'ARB'", "Accounting_RecurringBillables", ref val);
       GetFieldFromTable(connection, id, "Name", "Logistics_Features", ref val);
       return val ?? "";
 }
开发者ID:weavver,项目名称:data,代码行数:17,代码来源:Common.cs


示例17: AcquireBlobInfiniteLease

        public static void AcquireBlobInfiniteLease(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString blobName,
            SqlGuid proposedLeaseId,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            AzureBlobService abs = new AzureBlobService(accountName.Value, sharedKey.Value, useHTTPS.Value);
            Container cont = abs.GetContainer(containerName.Value);
            Blob blob = cont.GetBlob(blobName.Value);

            Responses.LeaseBlobResponse lbr = blob.AcquireInfiniteLease(
                proposedLeaseId.IsNull ? (Guid?)null : proposedLeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);

            PushLeaseBlobResponse(lbr);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:19,代码来源:BlobStorage.cs


示例18: GetReady

                public void GetReady() 
                {
                	byte [] b1 = new byte [16];
                	byte [] b2 = new byte [16];
                	byte [] b3 = new byte [16];
                	byte [] b4 = new byte [16];

                	b1 [0] = 1;
                	b1 [1] = 10;
                	b2 [0] = 100;
                	b2 [1] = 15;
                	b3 [0] = 100;
                	b3 [1] = 15;
                	b4 [0] = 250;
                	b4 [1] = 250;

                   	Test1 = new SqlGuid (b1);
			Test2 = new SqlGuid (b2);
                	Test3 = new SqlGuid (b3);
                	Test4 = new SqlGuid (b4);
                }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:21,代码来源:SqlGuidTest.cs


示例19: SqlGuidTest

        public SqlGuidTest()
        {
            byte[] b1 = new byte[16];
            byte[] b2 = new byte[16];
            byte[] b3 = new byte[16];
            byte[] b4 = new byte[16];

            b1[0] = 1;
            b1[1] = 10;
            b2[0] = 100;
            b2[1] = 15;
            b3[0] = 100;
            b3[1] = 15;
            b4[0] = 250;
            b4[1] = 250;

            _test1 = new SqlGuid(b1);
            _test2 = new SqlGuid(b2);
            _test3 = new SqlGuid(b3);
            _test4 = new SqlGuid(b4);
        }
开发者ID:dotnet,项目名称:corefx,代码行数:21,代码来源:SqlGuidTest.cs


示例20: ClassifyBusinessNeed

        public string ClassifyBusinessNeed(string id, string xml)
        {
            string rez = string.Empty;
            string json = string.Empty;
            XmlDocument xm = new XmlDocument();
            SqlGuid gid = new SqlGuid();
            try
            {
                gid = SqlGuid.Parse(id);
            }
            catch { };

            using (SqlConnection con = new SqlConnection(connectionString()))
            {

                con.Open();
                SqlCommand command = new SqlCommand("dbo.ClassifyBusinessNeed", con);
                command.Parameters.Add("@Id", SqlDbType.UniqueIdentifier).Value = gid;
                command.Parameters.Add("@InXml", SqlDbType.Xml).Value = xml;

                command.Parameters.Add("@OutXML", SqlDbType.Xml).Direction = ParameterDirection.Output;
                command.CommandType = CommandType.StoredProcedure;

                SqlDataAdapter da = new SqlDataAdapter(command);
                int ret = command.ExecuteNonQuery();
                try
                {
                    rez = (string)command.Parameters["@OutXML"].Value;
                    xm.LoadXml(rez);
                    json = Newtonsoft.Json.JsonConvert.SerializeXmlNode(xm);
                }
                catch
                {
                    json = string.Empty;
                }
                con.Close();
            }
            return json;
        }
开发者ID:sergiygladkyy,项目名称:Newton,代码行数:39,代码来源:NewtonRest.svc.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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