我有一个很好的新PC,并在其上安装了SQL Server Management Studio.我有一个"问题",当我处于非活动状态大约30分钟时,我失去了与我连接的数据库服务器的连接.查询屏幕显示消息"未连接".
在我以前的电脑上,我整个周末都可以不活动,这没问题.我找不到"设置"或改变这一点的东西.有谁知道如何恢复旧情况?
我有一个VS.NET 2008项目.是否可以检查项目中未使用的类?使用FXcop,我可以找到未使用的变量和未使用的代码,但不是未使用的类.
如何使用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."
错误.
我有删除每个重复项的字符串列表,现在我想过滤它以获得最后5条记录.我怎样才能做到这一点?
到目前为止我得到了什么
List<string> query = otherlist.Distinct().Select(a => a).ToList();
Run Code Online (Sandbox Code Playgroud) 在IIS7中,您可以选择不同的应用程序池类型.我有4种类型可供选择
这些之间有什么区别,何时选择什么?
更新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结果)
我模拟了数据访问层的几种方法,但在某些方法中,设置了SQL输出参数的值.我怎么嘲笑这个?
方法:
Run Code Online (Sandbox Code Playgroud)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);
模拟(我尝试使用"OutRef",但这不起作用):
Run Code Online (Sandbox Code Playgroud)using (mocks.Record()) { Expect.Call(dal.ExecuteUsingStoredProcedure("",> null)).Return(true).IgnoreArguments().OutRef(1); }
但那没有用.当我执行SP GetUser时,设置了param返回值,但我不知道如何模拟它
我在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.任何人都可以帮助我匹配正则表达式
从.NET 4开始,可以使用<%:%>语法对文本进行HTML编码.
在转发器中,我使用以下语法来显示数据
<%# DataBinder.Eval(Container.DataItem, "fieldlabel")%>
Run Code Online (Sandbox Code Playgroud)
我知道在转发器中编码输出的唯一方法是使用"Server.HtmlDecode".是否可以在转发器中使用新的<%:%>,只需与数据绑定结合使用,这样我就可以删除丑陋的HtlmDecode语法.或者是一种扩展方法,我唯一的选择是提高可读性?
可以编写一个查询从某个表中获取所有该记录,其中某个字段包含一个数值?
类似于"选择街道从tbladdress,街道像'%0%'或街道像'%1%'等"
只有一个功能?
我在某处读到某人可以在运行时访问配置值,但在设计时不能访问.在这种情况下,运行时间和设计时间之间的区别是什么?
.net ×2
iis-7 ×2
asp.net ×1
c# ×1
c#-4.0 ×1
design-time ×1
html-encode ×1
lambda ×1
mercurial ×1
mocking ×1
refactoring ×1
repeater ×1
rhino-mocks ×1
runtime ×1
sql ×1
sql-server ×1
ssms ×1
unit-testing ×1