代码: 
siteConfig.MessagePageSize =Convert.ToInt32(reader["messagePageSize"]);
说明:reader读取的是数据库字段messagePageSize,整型,默认值为0
但就是这个0却转换不成功,siteConfig.MessagePageSize为整型
错误提示:
 messagePageSize
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.IndexOutOfRangeException: messagePageSizeSource Error:Line 66:                 siteConfig.MessagePageSize =Convert.ToInt32(reader["messagePageSize"]);
Line 67:                 siteConfig.ImageSavePath=reader["ImageSavePath"].ToString();
Line 68:             }
Source File: E:\Web\ChnValve\Site.Core\AccessDAL\SiteConfig.cs    Line: 66 
我试着下面代码:
object a=0;
int cc=convert.toint32(a);
却又可以转换成功
是什么原因呢?