Welcome to the CodeSmith Community!

Error in EntityUtil.cs

.netTiers

A description has not yet been added to this group.

Error in EntityUtil.cs

  • rated by 0 users
  • This post has 1 Reply |
  • 2 Followers
  • The fix in "Error in Filter.cs " seemed to not work. I restarted and ran the debugger and came up with the following error before the Error in Filter.cs

    In EntityUtil.cs

    public static void SetPropertyValue(Object item, String propertyName, Object propertyValue, out PropertyInfo property, bool convertBlankToNull)

    {

    property = GetProperty(item, propertyName);

    if (property != null && property.CanWrite)

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    {

    property = GetProperty(item, propertyName);

    if (property != null && property.CanWrite)

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    {

    property = GetProperty(item, propertyName);

    if (property != null && property.CanWrite)

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    {

    Object value = ChangeType(propertyValue, property.PropertyType,convertBlankToNull);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    property.SetValue(item, value, null);

    /* **************************************

     This is where the error is happening. Details:

    item Count = 4
       Note: None of the rows of data contain nulls.
    value = "ProductID="

     Error Message:

    System.Reflection.TargetInvocationException was unhandled by user code

    Message="Exception has been thrown by the target of an invocation."

    Source="mscorlib"

    StackTrace:

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
    at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, PropertyInfo& property, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 378
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue, Boolean convertBlankToNull) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 348
    at YourCompany.One.Entities.EntityUtil.SetPropertyValue(Object item, String propertyName, Object propertyValue) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Entities\EntityUtil.cs:line 335
    at YourCompany.One.Web.Data.EntityDataSourceFilter.EntityDataSourceFilterView.ExecuteSelect(DataSourceSelectArguments arguments) in C:\Documents and Settings\user\My Documents\YourCompany\NetTiers\2006-10-13\YourCompany.One.Web\Data\EntityDataSourceFilter.cs:line 239
    at System.Web.UI.WebControls.Repeater.GetData()
    at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
    at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
    at System.Web.UI.WebControls.Repeater.DataBind()
    at System.Web.UI.WebControls.Repeater.EnsureDataBound()
    at System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    ***************************************** */

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

  • I had an issue where the column in the primary table could be <null> ie doesn't necessarily have to have a value corresponding to one the related child table.

    When my [Entity].aspx page was being displayed which had such an Entity then I was getting a similiar error message to that shown above

    To deal with this scenario I updated the Filter tag expression for the EntityDataSourceFilter as follows.

    <data:EntityDataSourceFilter ID="RejectionReasonFilter5" runat="server" DataSourceID="RejectionReasonDataSource5"

    Filter='<%# Eval("RejectionReasonID") == null ? "RejectionReasonID < 1" : String.Format("RejectionReasonID = {0}", Eval("RejectionReasonID")) %>'/>

    In this case the value of RejectionReasonID can be a value from 1 upwards (in my case RejectionReasonID is a primary and identity key in my child table). So writing it as RejectionReasonID < 1 handles the null case nicely. Thankyou Mr Boole

Page 1 of 1 (2 items)