Print Page | Close Window

Bug in Sample Code?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=691
Printed Date: 11-Jun-2026 at 4:48am


Topic: Bug in Sample Code?
Posted By: seadrive
Subject: Bug in Sample Code?
Date Posted: 22-Feb-2008 at 11:23am
Hi guys and gals,
 
When I run the C# sample code in the RoleBasedAuthorizationWithGetSetInterceptors project, I receive an error:
 
 "Incorrect syntax near the keyword 'from'"
 
The error is thrown when trying to evaluate the line:
 
User aUser = pManager.GetEntity<User>(anRdbQuery)

in the GetRoles(PersistenceManager pManager, string pUserName) method of the LoginManager class, after submitting the login form with the default entries.

Just thought I'd let you know...
 
Regards,
 
Steve



Replies:
Posted By: GregD
Date Posted: 26-Feb-2008 at 6:11pm
Thanks, Steve. I'll look into it.
 
Greg Dunn
IdeaBlade
 


Posted By: davidklitzke
Date Posted: 23-Apr-2008 at 12:19pm
Steve,
 
There was a bad bug in DevForce 3.6.0.1 that caused this same error message.  We fixed this bug almost as soon as we found it in DevForce 3.6.0.2, but subsequently two customers reported these same symtoms on 3.6.0.2.  Unfortunately, we were not able to reproduce this problem.
 
If you can reproduce this same problem in DevForce 3.6.0.2 or higher please respond to this post or send email to mailto:support@ideablade.com - support@ideablade.com
 
David


Posted By: seadrive
Date Posted: 05-May-2008 at 1:26pm

Hi David,

I've tried to track this down.  Maybe this will help.

The Model project contains User.cs and its parent class, UserDataRow.cs.  At line 247 of UserDataRow.cs, you will find:

protected override TableMappingInfo CreateTableMappingInfo() {

RdbTableMappingInfo mappingInfo = new RdbTableMappingInfo(this);

mappingInfo.SourceOwnerName = "dbo";

mappingInfo.SourceTableName = "User";

mappingInfo.ConcurrencyColumnName = "";

// ColumnSelectionOption: allowColumnSelection

mappingInfo.SourceColumnNames = "UserId, UserName, FirstName, LastName, Email, IsLocked, IsAdministrator, IsTemplate, TemplateUserId, RowVersion, CreatedBy, CreatedByUserId, CreatedDate, ModifiedBy, ModifiedByUserId, ModifiedDate, ";

Doesn't seem like there should there be a comma at the end of that mappingInfo.SourceColumnNames string.  Whaddya think?
 
Regards,
Steve
 


Posted By: davidklitzke
Date Posted: 05-May-2008 at 4:29pm
You've found the 3.6.0.1 bug!  The reason that you are seeing it in 3.6.0.2 is that when we built the tutorials for 3.6.0.2, we did not regenerate the Model for each of the tutorials,  Therefore, what is included are the DevForce 3.6.0.1 files.
 
You can fix the problem by regenerating the Model.  Under "Options", be sure and check, "Generate All Files


Posted By: seadrive
Date Posted: 06-May-2008 at 9:41am
So... do I get a gold star or something? hahahaha
 
Thanks, I should have thought of regen'ing everything.
 
Steve
 


Posted By: davidklitzke
Date Posted: 06-May-2008 at 9:48am
You get a gold star.  Thank you so very much.  This one had been worrying me.



Print Page | Close Window