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


C# SqlDataReader.GetSqlGuid方法代码示例

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


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

示例1: SqlLogEntry

 /// <summary>
 /// Constructs an instance of IStoreLogEntry using parts of a row from SqlDataReader.
 /// Used for creating the store operation for Undo.
 /// </summary>
 /// <param name="reader">SqlDataReader whose row has operation information.</param>
 /// <param name="offset">Reader offset for column that begins operation information.</param>
 internal SqlLogEntry(SqlDataReader reader, int offset)
 {
     this.Id = reader.GetGuid(offset);
     this.OpCode = (StoreOperationCode)reader.GetInt32(offset + 1);
     this.Data = reader.GetSqlXml(offset + 2);
     this.UndoStartState = (StoreOperationState)reader.GetInt32(offset + 3);
     SqlGuid shardIdRemoves;
     shardIdRemoves = reader.GetSqlGuid(offset + 4);
     this.OriginalShardVersionRemoves = shardIdRemoves.IsNull ? default(Guid) : shardIdRemoves.Value;
     SqlGuid shardIdAdds;
     shardIdAdds = reader.GetSqlGuid(offset + 5);
     this.OriginalShardVersionAdds = shardIdAdds.IsNull ? default(Guid) : shardIdAdds.Value;
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:19,代码来源:SqlLogEntry.cs

示例2: DeserializeQueuedEvent

 private object DeserializeQueuedEvent(SqlDataReader result)
 {
     var eventTypeIdColumnId = result.GetOrdinal("EventTypeId");
     var eventDataColumnId = result.GetOrdinal("EventData");
     result.Read();
     var eventTypeId = result.GetSqlGuid(eventTypeIdColumnId).Value;
     return this.serializationMethod.Deserialize(new XmlSerializedData(eventTypeId, result.GetSqlXml(eventDataColumnId).CreateReader()));
 }
开发者ID:TheSoftweyrGroup,项目名称:Softweyr.EventStore,代码行数:8,代码来源:SqlServer2008PersistenceSession.cs

示例3: DeserializeEvents

        private EventStream DeserializeEvents(Guid id, SqlDataReader result)
        {
            var lastVersion = 0;
            var snapshotVersion = 0;
            var eventTypeIdColumnId = result.GetOrdinal("EventTypeId");
            var eventDataColumnId = result.GetOrdinal("EventData");
            var versionColumnId = result.GetOrdinal("Version");
            var snapshotVersionColumnId = result.GetOrdinal("SnapshotVersion");
            var events = new List<object>();
            while (result.Read())
            {
                var eventTypeId = result.GetSqlGuid(eventTypeIdColumnId).Value;
                lastVersion = result.GetSqlInt32(versionColumnId).Value;
                snapshotVersion = result.GetSqlInt32(snapshotVersionColumnId).Value;
                events.Add(this.serializationMethod.Deserialize(new XmlSerializedData(eventTypeId, result.GetSqlXml(eventDataColumnId).CreateReader())));
            }

            return new EventStream(id, lastVersion, snapshotVersion, events);
        }
开发者ID:TheSoftweyrGroup,项目名称:Softweyr.EventStore,代码行数:19,代码来源:SqlServer2008PersistenceSession.cs

示例4: GetGuidTest

		public void GetGuidTest ()
		{
			cmd.CommandText = "Select type_guid,id,convert(uniqueidentifier,null)";
			cmd.CommandText += "from string_family where id=1";
			reader = cmd.ExecuteReader ();
			reader.Read ();

			// Test for standard exceptions 
			GetMethodTests("Guid");

			// Test if data is returned correctly
			Assert.AreEqual (stringRow["type_guid"], reader.GetGuid(0),
				"#2 DataValidation Failed");

			// Test for standard exceptions 
			GetMethodTests("SqlGuid");

			// Test if data is returned correctly
			Assert.AreEqual (stringRow["type_guid"], reader.GetSqlGuid(0).Value,
				"#4 DataValidation Failed");
			reader.Close ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:22,代码来源:SqlDataReaderTest.cs


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