Index was outside the bounds of the array. IndexOutOfRangeException in LINQ to SQL
Im getting this exception in the
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); <---- HERE !!!
}
}
of one recently table association i created, there lots of same associations around the database, and this happened in the 4 specific tables i added. Its 1...* relationship and association is Primary Table -> Id (identity auto generated) Foreign PId column int not null.
I just dont get it....Im using SqlMetal for generation, i regenerated the schema, rebuild, same. This is caus开发者_JAVA百科ing while inserting row in DevExpress XtraGrid, but i dont think this should be issue, same control with same functionality but for different tables works ok.
I use grid's event for append value in a property when the entity creating. I disabled this but same again.
Recreated the association. No change, exception occurs.
Any ideas?
Turn off "Just My Code" in Visual Studio's debugging options then you should see that there's more to the stack trace where the exception occurs. The line you referenced is raising an event which is being handled (probably by XtraGrid) for the purpose of updating the UI in response to changes in the bound objects. The line itself isn't throwing the exception.
You will probably find a stack trace deep into the third party control. Hopefully DevExpress can help you resolve it. They're pretty good with support.
精彩评论