小编Ivo*_*Ivo的帖子

SQL Server Management Studio在一段时间不活动后断开连接

我有一个很好的新PC,并在其上安装了SQL Server Management Studio.我有一个"问题",当我处于非活动状态大约30分钟时,我失去了与我连接的数据库服务器的连接.查询屏幕显示消息"未连接".

在我以前的电脑上,我整个周末都可以不活动,这没问题.我找不到"设置"或改变这一点的东西.有谁知道如何恢复旧情况?

ssms

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

在.net项目中查找未使用的类

我有一个VS.NET 2008项目.是否可以检查项目中未使用的类?使用FXcop,我可以找到未使用的变量和未使用的代码,但不是未使用的类.

.net refactoring visual-studio

13
推荐指数
1
解决办法
8475
查看次数

MVC 5 AttributeRouting Catch All

如何使用MVC中的新属性路由创建捕获所有路由

我试过这个: [Route("{pagenode}", Order = 999)]

但是当我有一条命名路线时 [Route("contact"]

我收到了"Multiple controller types were found that match the URL. This can happen if attribute routes on multiple controllers match the requested URL."错误.

attributerouting asp.net-mvc-5

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

如何使用Lambda从列表中获取最后的x条记录

我有删除每个重复项的字符串列表,现在我想过滤它以获得最后5条记录.我怎样才能做到这一点?

到目前为止我得到了什么

 List<string> query = otherlist.Distinct().Select(a => a).ToList();
Run Code Online (Sandbox Code Playgroud)

c# lambda c#-4.0

8
推荐指数
2
解决办法
8895
查看次数

IIS7应用程序池类型之间有什么区别

在IIS7中,您可以选择不同的应用程序池类型.我有4种类型可供选择

  • 默认应用程序池
  • 经典.Net应用程序池
  • ASP.NET v4.0
  • ASP.NET v4.0 Classic

这些之间有什么区别,何时选择什么?

.net iis-7

6
推荐指数
1
解决办法
7248
查看次数

Mercurial添加新文件没有找到匹配的错误

更新Mercurial时遇到一个奇怪的问题.每当我将文件添加到我的存储库然后更新存储库的另一个位置(例如在CI过程中)时,就会发生错误"找不到匹配".然后当我删除到整个文件夹并再次克隆它没有问题,并添加新的文件.更新和删除不会产生问题

当我做"a"验证时显示以下内容:

data/test.txt.i@54:丢失revlog!54:空的或缺少test.txt test.txt@54:b80de5d13875在清单中找不到3个完整性错误!(第一次损坏的变更集似乎是54)

知道是什么原因引起的吗?

编辑

完整的痕迹:

ThoughtWorks.CruiseControl.Core.CruiseControlException:源控制操作失败:abort:data/test.txt.i@b80de5d13875:找不到匹配项!.进程命令:在ThoughtWorks.CruiseControl.Core.IntegrationRunner的ThoughtWorks.CruiseControl.Core.Sourcecontrol.Mercurial.Mercurial.GetSource(IIntegrationResult结果)的ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)中的hg update --noninteractive在ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest请求)中的.Build(IIntegrationResult结果)

version-control mercurial

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

模拟SQL输出参数

我模拟了数据访问层的几种方法,但在某些方法中,设置了SQL输出参数的值.我怎么嘲笑这个?

方法:

var wrappedParameters = new SqlParameter[3];
            wrappedParameters[0] = new SqlParameter("@username",username);
            wrappedParameters[1] = new SqlParameter("@password",password);
            wrappedParameters[2] = new SqlParameter("returnValue",SqlDbType.Int) { Direction =ParameterDirection.ReturnValue };

            dal.ExecuteUsingStoredProcedure("GetUser", wrappedParameters);
Run Code Online (Sandbox Code Playgroud)

模拟(我尝试使用"OutRef",但这不起作用):

using (mocks.Record())
        {
            Expect.Call(dal.ExecuteUsingStoredProcedure("",> null)).Return(true).IgnoreArguments().OutRef(1);
        }
Run Code Online (Sandbox Code Playgroud)

但那没有用.当我执行SP GetUser时,设置了param返回值,但我不知道如何模拟它

unit-testing rhino-mocks mocking

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

.NET Url重写根URL

我在IIS7中有以下规则:

    <rule name="RewriteAll" stopProcessing="true">
      <match url="^([^/]+)/?$" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        <add input="{URL}" negate="true" pattern="\.axd$" />
        <add input="{URL}" negate="true" pattern="\.png$" />
        <add input="{URL}" negate="true" pattern="\.gif$" />
        <add input="{URL}" negate="true" pattern="\.jpg$" />
        <add input="{URL}" negate="true" pattern="\.css$" />
        <add input="{URL}" negate="true" pattern="\.js$" />
      </conditions>
      <action type="Rewrite" url="default.aspx?page={R:1}" />
    </rule>
Run Code Online (Sandbox Code Playgroud)

那个抓住网址如http://mysite.com/contact/

我无法弄清楚使用规则来捕捉 http://mysite.com/并发送到例如home.aspx.任何人都可以帮助我匹配正则表达式

iis-7 url-rewriting

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

<%:%>转发器中HTML编码的语法

从.NET 4开始,可以使用<%:%>语法对文本进行HTML编码.

在转发器中,我使用以下语法来显示数据

<%# DataBinder.Eval(Container.DataItem, "fieldlabel")%>
Run Code Online (Sandbox Code Playgroud)

我知道在转发器中编码输出的唯一方法是使用"Server.HtmlDecode".是否可以在转发器中使用新的<%:%>,只需与数据绑定结合使用,这样我就可以删除丑陋的HtlmDecode语法.或者是一种扩展方法,我唯一的选择是提高可读性?

asp.net repeater html-encode

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

获取包含数字的所有记录

可以编写一个查询从某个表中获取所有该记录,其中某个字段包含一个数值?

类似于"选择街道从tbladdress,街道像'%0%'或街道像'%1%'等"

只有一个功能?

sql sql-server

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

运行时间与设计时间

我在某处读到某人可以在运行时访问配置值,但在设计时不能访问.在这种情况下,运行时间和设计时间之间的区别是什么?

design-time runtime

2
推荐指数
1
解决办法
5710
查看次数