在有人咆哮之前,应该对此表进行规范化,最佳实践等.我将承认这是我们在SQL Server 2008 R2中的旧表,我无法对其进行更改.话虽如此,这个表有以下几列:
"PreparedBy", "PrelimApprovalBy", "Approval1Signer", "Approval2Signer"
Run Code Online (Sandbox Code Playgroud)
所有这些字段都有用户名或NULL或''.我想获得相同用户名出现在上述2个或更多字段中的所有行.如果2场是NULL他们是不是一场比赛,他们是不匹配的,如果他们都'.所以NULL和''都需要被排除,因为它们不代表任何东西.
这里我想的是什么,但
我不喜欢它:我正在考虑检查WHERE子句中的所有排列(检查NULL和'')做一些事情的行
WHERE PreparedBy = PrelimApprovalBy OR PreparedBy = Approval1Signer OR ...
Run Code Online (Sandbox Code Playgroud)
必须有一个更好的方法来做到这一点.
.NET(VB.NET或C#)是否有一种方法,当发生异常时,转储每个线程的堆栈跟踪?基本上我想重现Visual Studio的Debug-> Threads窗口中发生的事情,看看发生异常时每个线程正在做什么
我想为FIX消息编写一个自定义的.NET序列化器/反序列化器(它不像XML).基本上,消息被编码为<tag>=<value>;<tag>=<value>;...
所以样本可能是:
51=2;20=hello;31=2
Run Code Online (Sandbox Code Playgroud)
我想使用我的FIX Serializer类,类似于我使用XMLSerializer类来序列化/反序列化消息的方式.我想我会写一个FIX消息类,如:
[Serializable]
public class FixMessage
{
[FIXValuePair(51)]
public double Price { get; set; }
[FIXValuePair(20)]
public string SomethingElse { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
关于如何编写这样的Serializer/Deserializer的任何指示?
有没有办法在TFS中停用项目?(不删除,只是停用,所以没人可以结账或签到)
这更像是一种预防措施,而不是一种强硬的执法.我们有一个分支的项目,但最近合并到一个主干.该项目已不再使用,我不希望任何人通过签入/签出任何内容而意外使用它.当我们完全测试合并时,它最终会被删除
如何在更改.NET Framework时迁移.RESX文件...
我正在将.NET框架从4.0更改为3.5(因为我们在第三方dll中发现了不兼容性)并且一切都很顺利,除了一些.RESX文件搞砸了.我开始手动修复它们但是我可以使用一些工具吗?或者你们是怎么做到的?
任何人都有任何想法为什么这不起作用(C#或VB.NET或其他.NET语言并不重要).这是我的问题的一个非常简化的例子(抱歉VB.NET):
Private itsCustomTextFormatter As String
Public Property CustomTextFormatter As String
Get
If itsCustomTextFormatter Is Nothing Then CustomTextFormatter = Nothing 'thinking this should go into the setter - strangely it does not'
Return itsCustomTextFormatter
End Get
Set(ByVal value As String)
If value Is Nothing Then
value = "Something"
End If
itsCustomTextFormatter = value
End Set
End Property
Run Code Online (Sandbox Code Playgroud)
如果你这样做:
Dim myObj as new MyClass
Console.WriteLine(myObj.CustomTextFormatter)
Run Code Online (Sandbox Code Playgroud)
你会对结果感到惊讶.它将打印"Nothing".任何人都知道它为什么不打印"Something"
这是每个建议的单元测试:
Imports NUnit.Framework
<TestFixture()> _
Public Class Test
Private itsCustomTextFormatter As String
Public Property CustomTextFormatter As …Run Code Online (Sandbox Code Playgroud) 可能重复:
装配版本的详细信息
如何在VS/.NET中生成程序集版本?我知道AssemblyInfo.cs或AssemblyInfo.vb中有几个字符串,如下所示:
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
Run Code Online (Sandbox Code Playgroud)
但是最终的装配版本是如何创建的?它是如何增加的?最后一个值存储在哪里?我们有一个自定义的内部发布环境,我想自定义程序集版本...我在谷歌环顾四周但找不到任何东西......任何指针?
我们使用Nant 0.91所以<choose>不可用.你如何在Nant 0.91中进行IF/ELSE?我想在NAnt 0.91中做一些(使用NAnt 0.92语法).[我不允许修改当前安装的NAnt 0.91]:
<choose>
<when test="${deploy.env=='PROD'}">
<property name="deploy.root.dir" value="\\${deploy.server}\${deploy.mode}\${app.dest.dir}\" />
</when>
<otherwise>
<property name="deploy.root.dir" value="\\${deploy.server}\${deploy.mode}\${deploy.env}\${app.dest.dir}\" />
</otherwise>
</choose>
Run Code Online (Sandbox Code Playgroud) 假设我有以下 FileHelpers Record 定义:
[DelimitedRecord(",")]
[IgnoreEmptyLines]
public class TestRecord
{
[FieldCaption("A")]
[FieldQuoted(QuoteMode.OptionalForBoth)]
public string A;
[FieldCaption("B")]
[FieldQuoted(QuoteMode.OptionalForBoth)]
public string B;
[FieldCaption("C")]
[FieldQuoted(QuoteMode.OptionalForBoth)]
public string C;
}
Run Code Online (Sandbox Code Playgroud)
我只对 A、B、C 列感兴趣。它们后面的任何列都可以忽略。例如,我希望能够处理这样的数据:
A,B,C,D,E
TestA1,TestB1,TestC1,TestD1,TestE1
TestA2,TestB1,TestC1,TestD1,TestE1
Run Code Online (Sandbox Code Playgroud)
或者:
A,B,C,D
TestA1,TestB1,TestC1,TestD1
TestA2,TestB1,TestC1,TestD1
Run Code Online (Sandbox Code Playgroud)
或者:
A,B,C
TestA1,TestB1,TestC1
TestA2,TestB1,TestC1
Run Code Online (Sandbox Code Playgroud)