小编Cha*_*aka的帖子

在函数(SQL Server)中执行动态sql时出错?

我创建一个函数来执行动态SQL并返回一个值.我得到"只有函数和一些扩展存储过程可以在函数内执行." 作为一个错误.

功能:

Create Function fn_GetPrePopValue(@paramterValue nvarchar(100))
returns int as
begin
declare @value nvarchar(500);

Set @SQLString  = 'Select Grant_Nr From Grant_Master where grant_id=' + @paramterValue

exec   sp_executesql
       @query = @SQLString,       
       @value = @value output

return @value   
end 
Run Code Online (Sandbox Code Playgroud)

执行:

Select dbo.fn_GetPrePopValue('10002618') from Questions Where QuestionID=114
Run Code Online (Sandbox Code Playgroud)

和:

Select fn_GetPrePopValue('10002618') from Questions Where QuestionID=114
Run Code Online (Sandbox Code Playgroud)

功能是正确调用还是函数不正确?

sql function sql-server-2008

19
推荐指数
1
解决办法
5万
查看次数

持续集成,持续交付和DevOps有什么区别?

我一起听到这些术语,并想知道有什么区别?它们与持续构建和持续部署有何关系?

continuous-integration continuous-delivery devops

14
推荐指数
1
解决办法
1万
查看次数

asp.net mvc的telerik网格的开源替代品?

我在没有预算支付控件的IT商店工作.是否有针对mvc的telerik网格的开源替代方案?我想为我的网页提供丰富的数据网格.

user-controls datagrid open-source asp.net-mvc-3

13
推荐指数
2
解决办法
2万
查看次数

Jquery有助于在textarea上强制执行maxlength?

这是Jquery在添加属性"maxlength"时强制执行textarea的maxlength.IE不支持Maxlength.如何调整我的代码以处理页面上的多个textarea?目前,如果我向任何textarea添加文本,它们都会倒计时具有相同的值.

jQuery的:

$(document).ready( function () {

maxLength = $("textarea").attr("maxlength");
    $("textarea").after("<div><span id='remainingLengthTempId'>" 
              + maxLength + "</span> remaining</div>");

    $("textarea").bind("keyup change", function(){checkMaxLength(this.id,  maxLength); } )

});

function checkMaxLength(textareaID, maxLength){

    currentLengthInTextarea = $("#"+textareaID).val().length;
    $(remainingLengthTempId).text(parseInt(maxLength) - parseInt(currentLengthInTextarea));

    if (currentLengthInTextarea > (maxLength)) { 

        // Trim the field current length over the maxlength.
        $("textarea").val($("textarea").val().slice(0, maxLength));
        $(remainingLengthTempId).text(0);

    }
}
Run Code Online (Sandbox Code Playgroud)

HTML:

Skills:
<textarea id="1" maxlength="200" rows="10" cols="60" ></textarea>

Postions:
<textarea id="2" maxlength="200" rows="10" cols="60" ></textarea>

Comments
<textarea id="3" maxlength="100" rows="10" cols="60" ></textarea>
Run Code Online (Sandbox Code Playgroud)

validation jquery textarea

10
推荐指数
2
解决办法
3万
查看次数

MVC应用程序的布局/设计模板?

是否有任何开源设计模板可用于asp.net MVC项目?厌倦了看到每个mvc项目都有的标准蓝白外观.

model-view-controller asp.net-mvc

7
推荐指数
1
解决办法
4万
查看次数

如何使用lambda表达式连接重写此LINQ?

看起来大多数LINQ都是用lambda表达式编写的.我如何使用lambda重写这个linq,有点混淆风格(尤其是连接)?

var responses =
            from c in questionRepository.GetReponses()
            join o in questionRepository.GetQuestions() on
            c.QuestionID equals o.QuestionID
            where c.UserID == 9999
            orderby o.DisplayOrder
       select new { o.QuestionText, c.AnswerValue };
Run Code Online (Sandbox Code Playgroud)

linq lambda join

7
推荐指数
2
解决办法
3万
查看次数

在MVC webgrid中添加"加载"指示符?

我正在使用MVC3并在webgrid中显示我的数据.我想显示我过滤/搜索时显示的加载指示符(加载图像).什么是最好的方法?

我的搜索过滤器(代码):

@using (Html.BeginForm())
{
     <fieldset  id="fieldset1" class="coolfieldset">

        <legend>Search for Towers Watson Subscribers/Contacts</legend>
        <div class="div-table">
        <div class="div-table-row">
            <div class="div-table-col">Reg Date:</div>
            <div class="div-table-col"><input id="regDateFrom" class="datepicker" name="regDateFrom" value="@regDateFrom" type="text" /> to <input id="regDateEnd" class="datepicker" value="@regDateEnd" name="regDateEnd" type="text" /></div>
        </div>
        <div class="div-table-row">
            <div class="div-table-col">Profile Mod Date:</div>
            <div class="div-table-col"><input type="text" id="profileModDateFrom" class="datepicker" value="@profileModDateFrom"  name="profileModDateFrom" /> to <input id="profileModDateEnd" class="datepicker" value="@profileModDateEnd" name="profileModDateEnd" type="text" /></div>
        </div>
        <div class="div-table-row">
            <div class="div-table-col">Last Name:</div>
            <div class="div-table-col"><input type="text" id="lastName" name="lastName" value="@lastName" /></div>
        </div>
          <div class="div-table-row">
            <div class="div-table-col"><input id="search" name="search" type="submit" …
Run Code Online (Sandbox Code Playgroud)

image loading webgrid asp.net-mvc-3

5
推荐指数
1
解决办法
2568
查看次数

将我的DAL代码重新分解为域驱动设计或更现代的设计(C#3.5)?

该开发仅限于Visual Studio 2010(客户端批准的软件).我们需要通过存储过程访问数据.我想避免让它过于复杂而且时间紧迫.我看到的大多数设计涉及EF和LINQ,不确定如何设计procs?

我想创建一个单独的代码库项目(使用Web UI):

Application.Domain
      -  Interact get/put stored procedures, entities

Application.Web
      - containing Web UI (JQuery, AJAX), WCF Service
Run Code Online (Sandbox Code Playgroud)

谁能给我一些关于如何处理Application.Domain的示例代码?

例子,我读过:

DAL\AppDAL.cs:

public static IEnumerable<TasCriteria> GetTasCriterias()
    {
        using (var conn = new SqlConnection(_connectionString))
        {
            var com = new SqlCommand();
            com.Connection = conn;
            com.CommandType = CommandType.StoredProcedure;

            com.CommandText = "IVOOARINVENTORY_GET_TASCRITERIA";
            var adapt = new SqlDataAdapter();
            adapt.SelectCommand = com;
            var dataset = new DataSet();
            adapt.Fill(dataset);

            var types = (from c in dataset.Tables[0].AsEnumerable()
                         select new TasCriteria()
                         {
                              TasCriteriaId = Convert.ToInt32(c["TasCriteriaId"]), …
Run Code Online (Sandbox Code Playgroud)

architecture asp.net data-access-layer repository

5
推荐指数
1
解决办法
810
查看次数

将横幅置于Bootstrap 3导航栏上方?

我有这个Bootstrap 3导航栏:http://www.bootply.com/xkcDjvQslb

我想要以下修改:

  1. 在固定导航栏上方添加横幅
  2. 向下滚动时隐藏横幅

我看到了以下示例:http://www.bootply.com/69848 ; 在引导程序上不是很好,当我拉相关代码时它会破坏我的菜单.

横幅(在导航栏上方)将是一个表格,左侧是标识,右侧是标题.我需要有人指出我正确的方向吗?

css banner navbar twitter-bootstrap-3

5
推荐指数
1
解决办法
3万
查看次数

Jquery从MVC url获取参数Id?

我有以下网址:http://www.xzy.com/AMS/Audit/Agency/10017397

我需要从这个网址中删除id:10017397?

我试过了:

  function GetURLParameter(sParam) {
            var sPageURL = window.location.search.substring(1);
            var sURLVariables = sPageURL.split('&');
            for (var i = 0; i < sURLVariables.length; i++)
            {
                var sParameterName = sURLVariables[i].split('=');
                if (sParameterName[0] == sParam)
                {
                    return sParameterName[1];
                }
            }
        }
Run Code Online (Sandbox Code Playgroud)

parameters url jquery asp.net-mvc-3

4
推荐指数
1
解决办法
9830
查看次数