We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Using Code Collapse with semicolon-delimited statements

We are using Essential Edit for dealing with SQL text. Often we have multiple SQL statements delimited by a semicolon. Example:
SELECT *
FROM table1
WHERE col1='test';
SELECT *
FROM table2
ORDER BY 1, 2;

We would like to use the Code Collapse to collapse these individal SQL statements. Any idea what statements we can put into the configurator file to achieve this? The complication is that there isn't anything to indicate the BeginBlock - this is either the start of the file or the start of the line following the previous ;.

Any help you can give me on this would be appreciated.

5 Replies

KN Karikalan Natarajan Syncfusion Team February 18, 2010 04:09 PM UTC

Hi,

I have attached the sample file that does your requirement.

Sample’s Link: http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Sample-1844444444.zip

Unzip the above link and run the sample.
1) Click Load Test file – to load sql file
2) Click Dsipay config file – to display the xml source



Thanks,
Karikalan N


TP Troy Pascoe February 20, 2010 05:52 AM UTC

Thanks. That works well.

Actually the start of the block isn't just on the word SELECT, but can also be update, insert, delete, create, drop, with, grant etc etc (very long list). I guess I can just code for all of these.


KN Karikalan Natarajan Syncfusion Team February 22, 2010 10:09 AM UTC

Hi,

Thanks.

Yes. You can code for all these you want to collapse.

Thanks,
Karikalan N


TP Troy Pascoe February 22, 2010 09:19 PM UTC

Is it possible to add the config text to my code programmatically? - I don't want to use a config file.

Thanks in advance.


KN Karikalan Natarajan Syncfusion Team February 23, 2010 12:20 PM UTC

Hi,

Sure. Edit control allows you to add the config text to your code programmatically.

Refer the UG link : http://help.syncfusion.com/ug_81/WindowsFormsUI_Edit/CreatingConfigurationSettingsProgrammatically.html

In above link, there is a simple sample code that will be helpful to add Config text programmatically.

Let me know if you have any question on this.

Thanks,
Karikalan N

Loader.
Live Chat Icon For mobile
Up arrow icon