Posted 15 years ago by Ralf Koch - CEO, KoTecH Enterprises, Inc.
Version: 4.0.0280
Avatar
Hi, I'm fairly new to the Syntaxeditor and want to get the SQL Highlighting done, but I an't seem to get it to work.
This is what I have so far based on some readings here and the Test Application:


Run this code in the initailization of the form:
SqlDynamicSyntaxLanguage sql = new SqlDynamicSyntaxLanguage("SQL", false);
sql.IsUpdating = true;
editor.Document.Language = sql;

I copied the "ActiproSoftware.SQL.xml" and the "SqlDynamicSyntaxLanguage.cs" into my application folder, renamed the namespaces in both but it does not seem to work.

Thanks

Comments (5)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ralf,

You don't want to set IsUpdating = true unless you are actually going to do some updating and then you need a corresponding false anyhow.

My guess is that you didn't update the type reference in the root SyntaxLanguage tag in the XML file to point to your SqlDynamicSyntaxLanguage type. It needs the correct Assembly and Namespace specified. Check out the Troubleshooting topic in the documentation because that points to what to do.

Let us know if you have trouble after that.


Actipro Software Support

Posted 15 years ago by Ralf Koch - CEO, KoTecH Enterprises, Inc.
Avatar
This is what is in the header of the xml file:

<SyntaxLanguage Key="SQL" LanguageDefinitionVersion="4.0" Secure="True" WordContainsAdditionalCharacters="@_"
SyntaxLanguageTypeName="MyNameSpace.SqlDynamicSyntaxLanguage, MyNameSpace"
xmlns="http://ActiproSoftware/SyntaxEditor/4.0/LanguageDefinition">

And the file is in the root directory of the application.
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Your SyntaxLanguageTypeName is wrong. The first thing before the comma needs to be the full namespace "dot" typename. Then after the comma is your assembly name that contains the type (excluding .dll or .exe). So if your SqlDynamicSyntaxLanguage class is in MyNameSpace in MyAssembly.exe, you'd have:
SyntaxLanguageTypeName="MyNameSpace.SqlDynamicSyntaxLanguage, MyAssembly"


Actipro Software Support

Posted 15 years ago by Ralf Koch - CEO, KoTecH Enterprises, Inc.
Avatar
Actually, the value of MyNameSpace is the same as the MyAssembly like in your testapplication.

What else could I be missing?
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ralf,

You never said exactly what the error is. Please post as much info as you can.

If it's the SqlDynamicSyntaxLanguage type not found error, then please post the exact namespace that SqlDynamicSyntaxLanguage is in inside your project and the exact assembly name that is output by the project containing SqlDynamicSyntaxLanguage.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.