Server Error in '/' Application.

Object of type 'System.DBNull' cannot be converted to type 'System.String'.

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.ArgumentException: Object of type 'System.DBNull' cannot be converted to type 'System.String'.

Source Error:


Line 34:            
Line 35:             //È¡µÃµ¥¸öquestion²¢ÏÔʾ·ÖÀàµÈÒ³ÃæÐÅÏ¢
Line 36:             QAitem question = QABL.getQAitem(ID);
Line 37:             int c = question.ClassID;
Line 38:             if (question.AskTopic == null)

Source File: d:\WEB\HTTPS\ct360_answer\details.aspx.cs    Line: 36

Stack Trace:


[ArgumentException: Object of type 'System.DBNull' cannot be converted to type 'System.String'.]
   System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast) +5951730
   System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) +197
   System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +203
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +96
   System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index) +35
   mySqlHelper.Cdb.getDataObjectInstance(String sql, Object obj, Object[] list) +1231
   BLL.QABL.getQAitem(Int32 id) +232
   details.Page_Load(Object sender, EventArgs e) in d:\WEB\HTTPS\ct360_answer\details.aspx.cs:36
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4087.0