本文整理汇总了C#中BlogRollItem.MarkOld方法的典型用法代码示例。如果您正苦于以下问题:C# BlogRollItem.MarkOld方法的具体用法?C# BlogRollItem.MarkOld怎么用?C# BlogRollItem.MarkOld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlogRollItem
的用法示例。
在下文中一共展示了BlogRollItem.MarkOld方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillBlogRoll
/// <summary>
/// Gets all BlogRolls in database
/// </summary>
/// <returns>
/// List of BlogRolls
/// </returns>
public override List<BlogRollItem> FillBlogRoll()
{
var blogRoll = new List<BlogRollItem>();
using (var conn = this.CreateConnection())
{
if (conn.HasConnection)
{
using (var cmd = conn.CreateTextCommand(string.Format("SELECT BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex FROM {0}BlogRollItems WHERE BlogId = {1}blogid ", this.tablePrefix, this.parmPrefix)))
{
cmd.Parameters.Add(conn.CreateParameter(FormatParamName("blogid"), Blog.CurrentInstance.Id.ToString()));
using (var rdr = cmd.ExecuteReader())
{
while (rdr.Read())
{
var br = new BlogRollItem
{
Id = rdr.GetGuid(0),
Title = rdr.GetString(1),
Description = rdr.IsDBNull(2) ? string.Empty : rdr.GetString(2),
BlogUrl = rdr.IsDBNull(3) ? null : new Uri(rdr.GetString(3)),
FeedUrl = rdr.IsDBNull(4) ? null : new Uri(rdr.GetString(4)),
Xfn = rdr.IsDBNull(5) ? string.Empty : rdr.GetString(5),
SortIndex = rdr.GetInt32(6)
};
blogRoll.Add(br);
br.MarkOld();
}
}
}
}
}
return blogRoll;
}
示例2: FillBlogRoll
/// <summary>
/// Gets all BlogRolls in database
/// </summary>
/// <returns>List of BlogRolls</returns>
public override List<BlogRollItem> FillBlogRoll()
{
List<BlogRollItem> blogRoll = new List<BlogRollItem>();
string connString = ConfigurationManager.ConnectionStrings[connStringName].ConnectionString;
string providerName = ConfigurationManager.ConnectionStrings[connStringName].ProviderName;
DbProviderFactory provider = DbProviderFactories.GetFactory(providerName);
using (DbConnection conn = provider.CreateConnection())
{
conn.ConnectionString = connString;
conn.Open();
using (DbCommand cmd = conn.CreateCommand())
{
string sqlQuery = "SELECT BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex " +
"FROM " + tablePrefix + "BlogRollItems ";
cmd.CommandText = sqlQuery;
cmd.CommandType = CommandType.Text;
using (DbDataReader rdr = cmd.ExecuteReader())
{
if (rdr.HasRows)
{
while (rdr.Read())
{
BlogRollItem br = new BlogRollItem()
{
Id = rdr.GetGuid(0),
Title = rdr.GetString(1),
Description = rdr.IsDBNull(2) ? string.Empty : rdr.GetString(2),
BlogUrl = rdr.IsDBNull(3) ? null : new Uri(rdr.GetString(3)),
FeedUrl = rdr.IsDBNull(4) ? null : new Uri(rdr.GetString(4)),
Xfn = rdr.IsDBNull(5) ? string.Empty : rdr.GetString(5),
SortIndex = rdr.GetInt32(6)
};
blogRoll.Add(br);
br.MarkOld();
}
}
}
}
}
return blogRoll;
}
示例3: FillBlogRoll
/// <summary>
/// Gets all BlogRolls in database
/// </summary>
/// <returns>
/// List of BlogRolls
/// </returns>
public override List<BlogRollItem> FillBlogRoll()
{
var blogRoll = new List<BlogRollItem>();
var connString = ConfigurationManager.ConnectionStrings[this.connStringName].ConnectionString;
var providerName = ConfigurationManager.ConnectionStrings[this.connStringName].ProviderName;
var provider = DbProviderFactories.GetFactory(providerName);
using (var conn = provider.CreateConnection())
{
if (conn != null)
{
conn.ConnectionString = connString;
conn.Open();
using (var cmd = conn.CreateCommand())
{
var sqlQuery = string.Format("SELECT BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex FROM {0}BlogRollItems ", this.tablePrefix);
cmd.CommandText = sqlQuery;
cmd.CommandType = CommandType.Text;
using (var rdr = cmd.ExecuteReader())
{
if (rdr.HasRows)
{
while (rdr.Read())
{
var br = new BlogRollItem
{
Id = rdr.GetGuid(0),
Title = rdr.GetString(1),
Description = rdr.IsDBNull(2) ? string.Empty : rdr.GetString(2),
BlogUrl = rdr.IsDBNull(3) ? null : new Uri(rdr.GetString(3)),
FeedUrl = rdr.IsDBNull(4) ? null : new Uri(rdr.GetString(4)),
Xfn = rdr.IsDBNull(5) ? string.Empty : rdr.GetString(5),
SortIndex = rdr.GetInt32(6)
};
blogRoll.Add(br);
br.MarkOld();
}
}
}
}
}
}
return blogRoll;
}