在 C# 中编译旧代码以解决 SQL 汇编错误
我有刚刚反编译的旧代码(源代码丢失了,但我们拥有它)。
我现在尝试重新编译它,但有这些错误:
Error 1 'System.Data.SqlTypes.SqlBoolean.operator true(System.Data.SqlTypes.SqlBoolean)': cannot explicitly call operator or accessor C:\NCESTableGenerator\NCESTableGenerator\db\OutputTableDAO.cs 89 32 NCESTableGenerator
在下面的代码片段上:
if (SqlBoolean.op_True(reader.GetSqlInt32(0) == 1))
和
Error 3 Cannot convert type 'bool' to 'sbyte' C:\NCESTableGenerator\NCESTableGenerator\Formatter.cs 172 30 NCESTableGenerator
在下面的代码片段上:
public static string GetEstimateFloatStr(double data, int sn, int num, ref bool roundedZero, ref bool lowN)
{
if (sn <= 30)
{
sbyte num1 = (sbyte) lowN;
lowN = true;
return "‡";
有什么想法吗?
I have old code that I just decompile (source was lost but we own it).
I'm now trying to recompile it but have these erros:
Error 1 'System.Data.SqlTypes.SqlBoolean.operator true(System.Data.SqlTypes.SqlBoolean)': cannot explicitly call operator or accessor C:\NCESTableGenerator\NCESTableGenerator\db\OutputTableDAO.cs 89 32 NCESTableGenerator
on the following piece of code:
if (SqlBoolean.op_True(reader.GetSqlInt32(0) == 1))
and
Error 3 Cannot convert type 'bool' to 'sbyte' C:\NCESTableGenerator\NCESTableGenerator\Formatter.cs 172 30 NCESTableGenerator
on the following piece of code:
public static string GetEstimateFloatStr(double data, int sn, int num, ref bool roundedZero, ref bool lowN)
{
if (sn <= 30)
{
sbyte num1 = (sbyte) lowN;
lowN = true;
return "‡";
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在第一行中,我认为将其重写为安全的
,第二行是麻烦的行(看起来可以因为返回而删除它),但如果您无法删除它,请将其更改为
或
由于 Sbyte 不符合所列的 CLS由 MSDN 提供。
In the first line I think it's safe to rewrite it as
and the 2nd one the troublesome line (looks like it can be removed because of the return) but if you cant remove it change it to
or
Since Sbyte is not CLS-Compliant as listed by MSDN.