我正试图将C#代码转换为vb.net,但我难以将C#中的“?”号改为vb.net。 我的法典
public audit_trail Mapper(IDataReader rdr)
{
audit_trail audit_trail = new audit_trail();
audit_trail.Log_id = rdr["Log_id"] is DBNull ? 0 : (int)rdr["Log_id"];
audit_trail.Host = rdr["Host"] is DBNull ? string.Empty : (string)rdr["Host"];
return audit_trail;
}
如何将标识“?”改为“vb.net?
我要说的是:
audit_trail.Host = rdr["Host"] is DBNull ? string.Empty : (string)rdr["Host"];
页: 1
if rdr["Host"] is DBNull.Value then
audit_trail.Host = string.Empty
else
audit_trail.Host = rdr["Host"]
end if
但是,这部法典太长,太多的法典,你是否认为要改用短文?