本文整理汇总了C#中System.Data.SqlClient.SqlDataReader.SafeGetGuid方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDataReader.SafeGetGuid方法的具体用法?C# SqlDataReader.SafeGetGuid怎么用?C# SqlDataReader.SafeGetGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.SqlDataReader
的用法示例。
在下文中一共展示了SqlDataReader.SafeGetGuid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupPaymentTerm
private void SetupPaymentTerm(PaymentTerm p, SqlDataReader reader)
{
p.Id = reader.SafeGetGuid(reader.GetOrdinal("Id"));
p.Code = reader.SafeGetInt(reader.GetOrdinal("Code")).Value;
p.Description = reader.SafeGetString(reader.GetOrdinal("Description"));
}
示例2: SetupSalesArea
private void SetupSalesArea(SalesArea s, SqlDataReader r)
{
s.Id = r.SafeGetGuid(r.GetOrdinal("Id"));
s.OrderCode = r.SafeGetString(r.GetOrdinal("OrderCode"));
s.SalesAreaName = r.SafeGetString(r.GetOrdinal("SalesArea"));
}
示例3: SetupContractor
private void SetupContractor(Contractor c, SqlDataReader reader)
{
c.Id = reader.SafeGetGuid(reader.GetOrdinal("Id")).Value;
c.Name = reader.SafeGetString(reader.GetOrdinal("Name"));
c.Ref = reader.SafeGetString(reader.GetOrdinal("Ref"));
c.Mobile = reader.SafeGetInt64(reader.GetOrdinal("Mobile"));
c.SalesAreaName = reader.SafeGetString(reader.GetOrdinal("SalesArea"));
c.TravelDistance = reader.SafeGetInt(reader.GetOrdinal("TravelDistance")).Value;
c.TravelTime = reader.SafeGetInt(reader.GetOrdinal("TravelTime")).Value;
}