【发布时间】:2013-07-01 12:59:51
【问题描述】:
您好,我需要帮助才能在我的 liq 代码中使用子字符串来获取一些保存在 DB 中的借出数据。我想在 v.Description 中使用
v.Description.substring(0,399) 一些东西
这是我的代码
public static string BindeWorkOutDetails(int Id, Label Header,
Label Title, Label Description)
{
DataClassesDataContext con =
new DataClassesDataContext(con);
var q = (from v in con.WorkoutSettings
where v.Id == Id
select new { v.Header ,v.Title, v.Description,
v.ImageUrl }).First();
Header.Text = q.Header;
Title.Text = q.Title;
Description.Text = q.Description;
return q.ImageUrl;
}
请不要让我知道如何在 Linq 中使用子字符串,请重新编码我的这段代码
谢谢
【问题讨论】:
标签: c# asp.net sql-server linq c#-4.0