我现在一直在寻找解决方案,我似乎仍然无法找到解决方案.我在脚本组件中获取连接时遇到问题.在将其插入之前,我需要查询我的数据库以检索要使用的Id
public override void AcquireConnections(object Transaction)
{
connMgr = base.Connections.Connection;
conn = (SqlConnection)connMgr.AcquireConnection(null);
}
Run Code Online (Sandbox Code Playgroud)
我在这里得到一个例外.
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.SqlClient.SqlConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
Run Code Online (Sandbox Code Playgroud)
有解决方案吗
有谁知道如何访问枚举类型的"显示名称"数据注释?
我有一个带显示名称的枚举类型
class enum SomethingType {
[Display(Name = "Type 1")]
Type1,
[Display(Name = "Type 2")]
Type2
}
Run Code Online (Sandbox Code Playgroud)
以及引用它的模型类
class ModelClass {
public SomethingType Type {get; set;}
}
Run Code Online (Sandbox Code Playgroud)
如何在ModelClass中显示值的显示名称?
谢谢.
我有一封带有表的电子邮件,一个值包含多行字符串。(输入键)在Outlook中查看或在IE中查看源时,空格不起作用。
有什么想法或解决方案吗?
谢谢。