"Field" does not belong to table error.


Author
Message
Ertan Deniz
Ertan Deniz
StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)
Group: Forum Members
Posts: 163, Visits: 493
To handle this error, I've generated FieldAccessing Event for all fields.

But the code that event is fired comes after the code that column is accessed. So, I couldn't handle this condition. I'm trying to catch property access, check column if exist. If column does not exist then column will be added to the table.

Is there alternative way to accomplish tis type of requirement ? 

object loValue;

CompaniesFieldAccessingEventArgs e;

System.String loReturn;

loValue = this.CurrentRow["name"];

if (loValue == DBNull.Value)

{

loReturn = String.Empty;

}

else

{

loReturn = (System.String)loValue;

}

e = new CompaniesFieldAccessingEventArgs(CompaniesFieldNames.name, loReturn);

this.OnFieldPropertyAccessing(this, e);

return (System.String)e.ValueToReturn;


Reply
Ertan Deniz
Ertan Deniz
StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)
Group: Forum Members
Posts: 163, Visits: 493
I know your method. I couldn't get answer how to use this method. See post below.

http://forum.strataframe.net/Topic15238-6-1.aspx

if you give a new position for FieldAccessing Event. This may solve the situation.

But I need quick way to progress. Where is the place to call the method. (EnsureColumnExist) There must be a central point.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search