About SubSonic3.0 where InvalidOperationException is not handled (a syntax error exists near the TOP keyword)

Source: Internet
Author: User

When testing the program in the morning, I used the Top attribute and did not expect to immediately throw a "not handled InvalidOperationException exception (syntax error near the keyword 'top')" error message. See:

 

 

Then Debug and find that TOP 100 is stuck with the following content, for example:

 

After modifying the plug-in code, we still encountered the same problem. We tracked the Code a little deeper and looked at the last generated SQL to find that the original TOP position was incorrect, I wiped...


Set the TOP file and location in the plug-in:



Use Debug to find the SQL generation template, as shown in :()

 


Add the {8} parameter (File Name: Sql2005Generator. cs)

 

 


Then modify the other location of the file :()

 

 

Next, open ANSISqlGenerator. cs and add the GenerateTop () function to it.

 

Find the GenerateCommandLine () function and comment out the code for setting TOP according to the image.


Then you can generate the plug-in again.

 

This article is original content. Keep the following information for reprinting.

As long as you want to learn and make progress together, if you are interested, you can add the Q group: SubSonic3.0 Learning Group (327360708) or Email to me (1654937 # qq.com ), I am very busy. If you have any questions, please leave a message first. Please forgive me for not replying in time.

For more questions about SubSonic3.0, refer to the blog:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.