Build errors: Newline in constant error and Invalid token

Posts   
 
    
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 22-Oct-2009 02:32:26   

Hello, I am using LLBLGenPro 2.6 (June 2008 ) and Visual Studio 2005. I am using Adapter, C# with Adapter.General2005. I connect to an Oracle 10g database.

I have had a successful project going for quite a while, but refreshed the catalog to add a new view I added as an entity. (I generated new classes to an empty folder and also removed and re-added references.)

I am now getting build errors re the code generated for the new view: "Newline in constant" in the file "Sapep23ElementViewTypedView.cs".

In Visual Studio, I was prompted to make the line ending consistent, and chose yes, Windows line ending. Some of the errors were fixed. (However, since this is generated code, I'm guessing this isn't a good idea.) I get the same "Newline in constant" error in "PersistenceInfoProvider.cs".

A second error I now have is 'Invalid token "<br/>" in class, struct, or interface member declaration'. I can see this token inserted in the code.

Should I be recreating my view? This is a large view, combining five tables. But I have several other views as entities and have never had this problem before.

Another problem that I seem to have often, is that when I regenerate code I lose the mapping to the .dlls for the two database projects cep.dll and cep.DBSpecific.dll.

Thanks for any suggestions, Carol

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 22-Oct-2009 06:45:04   

cgray wrote:

I am now getting build errors re the code generated for the new view: "Newline in constant" in the file "Sapep23ElementViewTypedView.cs".

In Visual Studio, I was prompted to make the line ending consistent, and chose yes, Windows line ending. Some of the errors were fixed. (However, since this is generated code, I'm guessing this isn't a good idea.) I get the same "Newline in constant" error in "PersistenceInfoProvider.cs".

A second error I now have is 'Invalid token "<br/>" in class, struct, or interface member declaration'. I can see this token inserted in the code.

What template set are you generating? Are you generating other stuff like ASP.Net GUI templates? Would be helpful if you attach your LGP to see if we can reproduce it.

cgray wrote:

Another problem that I seem to have often, is that when I regenerate code I lose the mapping to the .dlls for the two database projects cep.dll and cep.DBSpecific.dll.

Do you mean losing references on your GUI/BIZ projects or losing references on your generated projects? Are you referencing the projects into your solution or just dlls?

David Elizondo | LLBLGen Support Team
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 23-Oct-2009 00:40:05   

Hello, I am using SD.Presets.Adapter.General2005 and SD.TemplateBindings.OracleMSSpecific.NET20. I don't think I am generating any other templates. (Although I'd like to add a GUI template, soon!)

I will attach the file eaopqa.lgp (252 KB). Is this all that is needed?

I reference the projects cep and cepDBSpecific. However, I get the error:

Error 37 Metadata file 'C:\Documents and Settings\Carol\My Documents\Visual Studio 2005\Projects\eaopqa\DatabaseSpecific\bin\Debug\cepDBSpecific.dll' could not be found

This is for both cepDBSpecific.dll and cep.dll. In the past I have searched for the .dll file and then copied it to the location above and then added a reference. I'm guessing that now the absence of this file may be due to not yet having a successful build.

Thanks for your assistance, Carol

(edit) Attachment removed as the thread has been resolved, as it's a public forum. -- Otis

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 23-Oct-2009 11:08:19   

I have checked the attached LLBLGen file, I generated the code and opened it in VS2008 (after converting the code). Problems are reproduced.

Hang on.

(Edit) The strangest thing, is that all the errors are only in the new entity class Sapep23ElementView_Entity or the Sapep23ElementViewTypedView. And even in the PersistenceInfoProvider.cs the errors are all related to them.

So all goes back to the same database view, either mapped to an entity or to a typedView.

(Edit) Generating to .NET 3.5 gives the same errors.

(Edit) The entity and the typedView both contain 22 fields, and the errors are all related to the xml generated comments for the generated corresponding properties of only 6 specific fields.

And I can't find out what's special about these 6 fields. Why the other fields code and comments are generated correctly but not these!!

(Edit) Got itsunglasses All these fields (database fields) have spaces in their name. You should avoid spaces when defining database fields/columns.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 23-Oct-2009 12:04:48   

still, spaces in fields are supported, likely a bug in the templates, I'll look into it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 26-Oct-2009 09:46:26   

hmm. this is VERY weird. CRLF's are present inside the field names, looking into it.

(edit) from the looks of it, the view's fields in the database contain carriage returns! simple_smile Please go to the catalog explorer, browse down to SAPEP_23_ELEMENT_VIEW and then click 'fields'. it will open the fields in the details pane.

In the fields list you'll see ST_FIRST_NAME and SEN_GRADE_LEVEL and a couple of others which have a weird character in their name, looking like a small box. That's the CRLF character, which isn't displayable.

So please go to the Oracle box, and change the view's field names to proper field names without the carriage returns, then refresh the catalog and regenerate the code.

Frans Bouma | Lead developer LLBLGen Pro
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 26-Oct-2009 20:32:00   

Hello, I have been off line for a couple of days, but just tried changing the field names within my llblgen project as you suggested.

Sorry to be so clueless, but I'm not sure what is meant by the "Oracle box". I go to the catalog explorer, browse down to the view which is listed under the Schema, and click fields under SAPEP_23_ELEMENT_VIEW, and then see the list of fields. The Oracle database fields appear in caps on the right (View field) and the Field Name on the left. This is in the lists of "Fields mapped on view fields", which is under the tab "Typed Views\Sapep23Element View". Here I do see what looks like an extra space ST [space] _FIRST_NAME. However, I am not able to edit this here to remove the space. (Under Field properties I see that I can change the Field Name and Caption.)

In my original table field names, there are no spaces, only underline characters. The view was generated for me by the DBAs at our data center, so perhaps the view is corrupted? I manage the database through using Oracle SQL Developer and I am using SD.LLBLGen.Pro.DQE.OracleMS.NET20.

Thanks for help with this very weird problem. Carol

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 26-Oct-2009 20:58:12   

You've to change the field names in the view definition in oracle, so with 'oracle box' I meant the oracle database. simple_smile

the field names are retrieved with a query, and I can only conclude that the field names of the view in the meta-data inside Oracle contains CR/LF's (which are stripped out when creating field names in the TYPED view in the project).

Perhaps trying to re-create the view in the Oracle schema in Oracle might work?

The query used to obtain the metadata for the view is: SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, DATA_DEFAULT FROM ALL_TAB_COLUMNS WHERE OWNER=<schema> AND TABLE_NAME = :viewName ORDER BY TABLE_NAME ASC, COLUMN_ID ASC

where :viewname is the parameter for the view name, so replace that with 'SAPEP_23_ELEMENT_VIEW' and replace <schema> with your schema's name (e.g. 'SCOTT')

Frans Bouma | Lead developer LLBLGen Pro
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 26-Oct-2009 21:22:40   

OK, Sure, makes sense ! simple_smile I have to go through the Oracle DBAs to make this change, but they are very helpful and will probably have a new view created within a couple of hours. I'll hopefully post with a successful build very soon. Thanks, Carol

cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 28-Oct-2009 00:12:45   

Success! smile Recreating the view, refreshing the catalog and re-generating the code solved the problem. The Oracle DBAs confirmed that there were line breaks in the view that are now removed.

Thanks so much for your help with this problem, and all the effort figuring out what was happening.

Carol