自动映射dbNull StrongTypingException

时间:2013-11-11 16:03:39

标签: c# ms-access automapper

我正在使用Automapper来读取访问数据库。读取字符串,并获得异常:

System.Data.StrongTypingException was unhandled by user code
HResult=-2146232021
Message=The value for column 'MapBook' in table 'tblBidSetup' is DBNull.

这是一个字符串,所以绝对是nullable。知道如何避免这种异常吗?

1 个答案:

答案 0 :(得分:-1)

在automapper中使用try catch来绕过错误