我正在研究一些遗留SQL,并且作者分隔了每个列名和数据类型声明.请参阅以下内容:
CREATE TABLE SomeTable (
[SomeDate] [datetime] NOT NULL,
[SomeInt] [int] NOT NULL,
[SomeString] [nvarchar] NOT NULL
) ON [PRIMARY]
GO
在为SQL Server编写T-SQL时,这被认为是最佳做法吗?由于我现在正在维护此代码,我应该继续练习吗?
这是我的heirarchy:
class abstract Entity { /*members*/ } // mapped to entity table
class abstract User : Entity { /*members*/ } // mapped to user table
class Employee : User { /*no members*/ } // no table, discriminator = "E"
class Contractor : User { /*no members*/ } // no table, discriminator = "C"
这是我在两个单独的hbm文件中的映射:
<class name="Entity" table="entity" xmlns="urn:nhibernate-mapping-2.2">
<id name="Id" column="id">
<generator class="guid.comb" />
</id>
<property ... />
</class>
<joined-subclass name="User" extends="Entity" table="user">
<key column="id" />
<discriminator column="type" />
<property … 关于这里的帖子,一旦他们被展示和解决后如何删除这些错误?
我通过以下方式添加了错误:
var errorArray = {};
errorArray["Slug"] = 'Some error message for the Slug text box';
$('#SomeFormId').validate().showErrors(errorArray);
Run Code Online (Sandbox Code Playgroud)
但是我无法在表单的ajax帖子之后清除错误.
我有一个 WCF 服务,它跨几个数据库和 Active Directory 执行一些更新。由于 Active Directory 无法支持事务,因此我想在“DirectoryRepository”类中实现,该类将在发生回滚时执行补偿操作。
我的代码正在使用 TransactionScope ...
using(var scope = new TransactionScope())
{
AssetRepository.Add(asset);
DeploymentRepository.Add(deployment);
DirectoryRepository.Add(directoryEntry);
scope.Complete();
}
Run Code Online (Sandbox Code Playgroud)
我的 DirectoryRepository 如何知道任何当前事务并在回滚时得到通知?
我想念什么?
<add name =“ test”
connectionString =“ Data Source = TEST_ORACLE;集成安全性=是;” />
[ArgumentException:“集成安全性”是无效的连接字符串属性]
Oracle.DataAccess.Client.OracleConnection.ParseConnectionString()+2707
Oracle.DataAccess.Client.OracleConnection.set_ConnectionString(字符串值)+533
Oracle.DataAccess.Client.OracleConnection..ctor(字符串connectionString)+210
ODP.NET:Oracle.DataAccess-2.102.2.20(我使用的是这个版本的bindingRedirect。)
如果我取出Integrated Security并声明用户ID和密码,则它可以正常运行。因此,我知道ODP.NET没错。
我是一名暂时在网络上工作的桌面应用程序开发人员.我正在与一个客户合作,希望我构建一个应用程序供全州各地使用; 但是,这些位置的连接非常不稳定.
他们真的想要一个集中的网络应用程序,并建议我建立一个"精益"的网络应用程序.我不知道"精益网络应用程序"是什么意思:小的HTTP请求,但很多?或者只有少数几个的大型HTTP请求?我倾向于支持chunky vs chatty ..但我以前从未担心过连接问题.
我是否建议在连接存在时复制数据的桌面应用程序?如果没有,当连接不稳定时,接近Web应用程序的最佳方法是什么?
编辑:我必须通过进一步的信息来证明我的问题.假设有web选项,他们不允许使用浏览器运行时技术和任何需要安装的东西.因此,Silverlight出局,Flash已经出局,Gears出局 - 只有asp.net和javascript可供我使用.说明这一点,我的部分问题是是否使用桌面应用程序; 我想这可以扩展到"更厚的技术".
编辑#2:网络是同构的 - 每个节点都是Windows.这不会改变.
我的尝试(如下)失败了:
<Canvas x:Key="Lock" ... />
<Canvas x:Key="解锁" ... />
<Style x:Key="LockButtonStyle" TargetType="{x:Type Button}">
<样式.触发器>
<DataTrigger Binding="{Binding Path=IsReadOnly}" Value="True">
<DataTrigger.Setters>
<Setter Property="Content" Value="{StaticResource Lock}" />
</DataTrigger.Setters>
</数据触发器>
<DataTrigger Binding="{Binding Path=IsReadOnly}" Value="False">
<DataTrigger.Setters>
<Setter Property="Content" Value="{StaticResource Unlock}" />
</DataTrigger.Setters>
</数据触发器>
</Style.Triggers>
</样式>
...
<Button Content="{StaticResource Lock}" />
我试图让按钮在 ViewModel 上的 IsReadOnly 属性更改时更改(它以“IsReadOnly”作为 PropertyName 触发 INotifyPropertyChanged.PropertyChanged)。我错过了什么?
.NET 3.5
答案(至少对我来说 - 不支持一般情况):
我刚刚为布尔属性绑定编写了一个快速转换器。
[ValueConversion(typeof(bool), typeof(object))]
公共类 BooleanValueConverter : IValueConverter
{
公共对象 FalseValue { 获取;放; }
公共对象 TrueValue { 获取;放; }
#region IValueConverter 成员
公共对象转换(对象值,类型目标类型, … SQL是:
execute ('delete from HttpRequests where Date < ''2009-08-' + convert(nvarchar(max), 0) + '''')
Run Code Online (Sandbox Code Playgroud)
错误是
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'convert'.
Run Code Online (Sandbox Code Playgroud)
注释掉转换部分会删除错误.怎么了?
我写了一些jQuery来从具有某个类的表中选择单元格; 在这种情况下,"你好".但是,该表具有嵌套表,其中包含相同类的列.如何从外表中选择单元格但不从内部选择单元格?见下文:
HTML:
<table class="foo"> <!-- this is the outer table
<tbody>
<tr>
<td class="hello"> <!-- select this cell
<table> <!-- this is the nested table
<tbody>
<tr>
<td class="hello"> <!-- do not select this cell
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
jQuery:
// this selects the nested cells as well
$('table.foo:first').find('td.hello').doSomething();
c# ×3
.net ×2
jquery ×2
sql-server ×2
t-sql ×2
asp.net ×1
asp.net-mvc ×1
datatrigger ×1
hbm ×1
html ×1
nhibernate ×1
odp.net ×1
oracle ×1
sql ×1
transactions ×1
triggers ×1
wpf ×1