我怎样才能做空?
How can I get ushort?
ID = reader.GetInt16(2) //ID: ushort
会报错Error
"Cannot implicitly convert type 'short' to 'ushort'. An explicit
conversion exists (are you missing a cast?)".
在不将我的 属性 更改为 short 的情况下获取数据的最佳做法是什么?
如错误所述,您可以转换为 ushort
:
ID = (ushort) reader.GetInt16(2);
ID = reader.GetInt16(2) //ID: ushort
会报错Error
"Cannot implicitly convert type 'short' to 'ushort'. An explicit conversion exists (are you missing a cast?)".
在不将我的 属性 更改为 short 的情况下获取数据的最佳做法是什么?
如错误所述,您可以转换为 ushort
:
ID = (ushort) reader.GetInt16(2);