这里有人可以帮助我吗?我有以下代码:
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
var node = @Model.NodeById(1257);
}
<div class="Top10">
<h1>Newest</h1>
@foreach (var article in node.Descendants().Where("Visible && (NodeTypeAlias = \"Article\" || NodeTypeAlias = \"sergrein\" || NodeTypeAlias = \"solomyndagrein\")").OrderBy("createDate desc").Take(10))
{
<a href="@article.Url"><h2>@article.createDate.ToString("dd/MM") | @article.title</h2></a>
}
</div>
Run Code Online (Sandbox Code Playgroud)
我想要的是:如果@ article.title的长度大于例如10个字符,则它需要返回10个字符,后跟...(例如:“ this_is_a _...”)。如果@ article.title少于10个字符,则只能显示完整的标题长度。如何截断?
我正在尝试从表中读取数据。这个表有一个表名列表。
对于数据集的每一行,我想运行几个查询来提取数据并将其插入到临时表中。
这是我所做的
DECLARE @campName varchar(255);
DECLARE @sqlCommand varchar(1000);
DECLARE @sqlCommandMySQL varchar(1000);
DECLARE @LastRun varchar(60);
DECLARE @OPENQUERY varchar(1000);
DECLARE MY_CURSOR CURSOR
LOCAL STATIC READ_ONLY FORWARD_ONLY
FOR
SELECT LTRIM(RTRIM(CallListName)) AS CallListName
FROM [SMSQL1].[RDI_System].[dbo].[Campaigns]
WHERE dialer_campaign = 1 AND i3Server ='I3New' AND ClientID = 111 AND (EndDate IS NULL OR EndDate >= getdate() - 7)
OPEN MY_CURSOR
FETCH NEXT FROM MY_CURSOR INTO @campName
WHILE @@FETCH_STATUS = 0
BEGIN
--SET @LinkedServer = 'GUARDIAN';
SET @OPENQUERY = 'SELECT @LastRun = lr FROM OPENQUERY(GUARDIAN,''';
SET …Run Code Online (Sandbox Code Playgroud)