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


C# IDnaDataReader.ExecuteWithOpenKey方法代码示例

本文整理汇总了C#中IDnaDataReader.ExecuteWithOpenKey方法的典型用法代码示例。如果您正苦于以下问题:C# IDnaDataReader.ExecuteWithOpenKey方法的具体用法?C# IDnaDataReader.ExecuteWithOpenKey怎么用?C# IDnaDataReader.ExecuteWithOpenKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDnaDataReader的用法示例。


在下文中一共展示了IDnaDataReader.ExecuteWithOpenKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateUserEmailAddress

        void UpdateUserEmailAddress(IDnaDataReader reader, int userId, string email)
        {
            string sql;
            
            if (email != null)
                sql = string.Format(@"update users set encryptedemail=dbo.udf_encryptemailaddress('{0}',{1}) where userid={1}",email,userId);
            else
                sql = string.Format(@"update users set encryptedemail=dbo.udf_encryptemailaddress(NULL,{0}) where userid={0}",userId);

            reader.ExecuteWithOpenKey(sql);
            reader.Close();
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:EmailEncryptionTests.cs

示例2: HashEmailAddress

 SqlBinary HashEmailAddress(IDnaDataReader reader,string email)
 {
     reader.ExecuteWithOpenKey("select dbo.udf_hashemailaddress('" + email + "') AS HashedEmail");
     reader.Read();
     var hashedEmail = reader.GetSqlBinary("HashedEmail");
     reader.Close();
     return hashedEmail;
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:8,代码来源:EmailEncryptionTests.cs

示例3: values

//        create procedure fetcharticlemoderationhistory @h2g2id int


        /*

use smallguide
begin tran

select j1.forumid,u1.*
		FROM Users u1
		INNER JOIN Journals J1 ON J1.UserID = u1.UserID and J1.SiteID = 1
		--INNER JOIN FaveForums f ON f.ForumID = J1.ForumID
		--INNER JOIN Users u ON f.UserID = u.UserID
		--INNER JOIN Journals J on J.UserID = u.UserID --and J.SiteID = 1
		--INNER JOIN Forums fo ON fo.ForumID = J.ForumID

insert FaveForums values (5819,5)

exec watchingusers @userid =5, @siteid =1, @skip = 0, @show = 100000
rollback tran
use master

         
                         */

        #endregion


        #region Helper methods



        EmailValues GetUserEmailValues(IDnaDataReader reader, int userId)
        {
            string sql = string.Format(@"SELECT DecryptedEmail = dbo.udf_decryptemailaddress(EncryptedEmail,UserID), EncryptedEmail, HashedEmail FROM Users WHERE UserId=" + userId);
            reader.ExecuteWithOpenKey(sql);
            reader.Read();

            EmailValues emailValues = new EmailValues();

            emailValues.DecryptedEmail = reader.GetString("DecryptedEmail");
            emailValues.EncryptedEmail = reader.GetSqlBinary("EncryptedEmail");
            emailValues.HashedEmail = reader.GetSqlBinary("HashedEmail");

            reader.Close();

            return emailValues;
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:48,代码来源:EmailEncryptionTests.cs


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