为Elmah设置SQL Server数据库的脚本有一条警告消息,指出数据库设计为在SQL Server兼容模式80(SQL Server 2000)下工作.有没有人知道在兼容模式90数据库上运行脚本来构建数据库是否有任何问题.
我有一个存储过程,它将消息放在SQL Server Service Broker消息队列中.如果出现问题并且消息没有放在消息队列中,我需要从存储过程返回错误消息.我看到的问题是,即使SQL Server Service Broker被禁用(这是我试图测试无法将消息放入队列的方式),当我运行TSQL代码时,它不会返回错误队列中的消息.
有谁知道如何检测是否在SQL Server Broker消息队列上放置消息失败?
我在下面编写了JQuery,并且必须使用多次调用.parent()来搜索DOM中的项目,因为在ASP.Net中呈现的ClientID是在html中动态构建的.我知道每次更改标记代码时都会出现问题,并且想知道是否有人知道在ASP.Net中更好的方法.
<script language="jquery" src="js/jquery-1.3.2-vsdoc2.js" type="text/javascript">
</script>
<script src="js/jquery.color.js" type="text/javascript">
</script>
script language="javascript" type="text/javascript">
$(document).ready(function() {
//Get the cost of the base item, then add the cost of the selected compoents as
//they get selected.
$(".AspNet-CheckBoxList > ul > li > input").click(function() {
var itemCost = 0;
$(this).find("fieldset:div:span");
itemCost = GetItemCost($(this).parent().parent().parent().parent()
.parent().parent().parent().children().find("span").text());
var Component = $(this).next("label").text();
if ($(this).attr("checked") == true) {
itemCost = (itemCost + GetItemCost(Component)).toFixed(2);
}
else {
itemCost = (itemCost - GetItemCost(Component)).toFixed(2);
}
$(this).parent().parent().parent().parent().parent()
.parent().parent().children().find("span").text("$" + itemCost);
$(this).parent().parent().parent().parent().parent()
.parent().parent().children().find("span").animate( …Run Code Online (Sandbox Code Playgroud) 我一直在研究重新编写WF4工作流程来调试运行的工作流程的可能性.我见过的关于WF4 Rehosting的所有帖子和示例都使用WPF应用程序来初始托管工作流,然后使用WorkflowDesigner重新构建它.有没有办法重新托管在非WPF应用程序中托管的工作流,比如ASP.Net MVC?
有没有人知道是否有.Net 4.0框架的SDK,如果有的话,安装程序将它放在硬盘上的哪个位置?我已经安装了Visual Studio 2010的Ultimate Edition,但无法在任何地方找到SDK.
我有一个在我的C#代码中调用的NHibernate查询返回一个似乎工作正常的对象数组,除非我尝试迭代数组中的项目以使用这些值.当我尝试使用foreach时,我得到一个例外:
Cannot apply indexing with [] to an expression of type 'object'.
这是代码的简化版本:
var counts =
GetSession().CreateQuery(
@"select Name, count(Id) from
Account
group by Name")
.Enumerable();
foreach (var count in counts)
{
string s = count[0];
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我弄清楚如何迭代返回的Enumerable的结果?
我发现,通过将KeyPath =“ yes”和Assembly =“。net”添加到Wix XML文件中的DLL组件中,在构建安装程序并运行它之后,它确实会安装我指定的DLL。将这些属性添加到GAC中。它还会将它们安装到我的本地程序文件夹中。我当时假设,如果将它们安装到GAC,则无需在程序文件夹中也包含它们。是否在两个位置都有DLL是一个问题,如果存在,是否有办法防止将它们安装到程序文件夹中?
我需要在C#中编写一个Regex,以确保字符串以S,R或V中的一个字符开头,然后有六个后续数字,如下所示:"S123456".这是我正在尝试使用的正则表达式:
@ "(S | R | V)[0-9] {6}?"
但是,如果我传递一个字符串太多,如"S1234567",它就会失败.我在这做错了什么?
我们有一个Visual Studio 2010解决方案,其中包含几个符合Jeffery Palermo的Onion Architecture模式的C#项目(http://jeffreypalermo.com/blog/the-onion-architecture-part-1/).我们有一个UI项目,它是一个ASP.Net MVC项目,我们有一个名为Infrastructure的C#类库项目,由UI项目引用.在我们的基础结构项目中,我们添加了一个app.config文件,以包含特定于Infrastructure项目的设置.在运行时,app.config文件似乎不可用于Infrastructure项目,只有UI项目中包含的web.config文件.我们不希望将与Infrastructure项目相关的设置放入UI项目中的web.config文件中,UI不需要这些设置.我们如何在运行时使Infrastructure的app.config文件可用?我们想也许我们应该在构建应用程序时将一个Post Build Copy复制到UI目录中 - 这是正确的方法,
c# ×3
.net ×1
.net-4.0 ×1
app-config ×1
dll ×1
dom ×1
elmah ×1
gac ×1
hosting ×1
iteration ×1
jquery ×1
navigation ×1
nhibernate ×1
reference ×1
regex ×1
sdk ×1
sql-server ×1
windows ×1
wix ×1