Questions about habits

Source: Internet
Author: User
Tags switch case

During the development process today, when using the Kendo UI, you can obtain data through ef. When the image page is displayed, the data stored in the data needs to be converted to another display. For example, if the database field is saved as "S", the display on the page is success, the first response is to use the for loop when getting data in the background, and then convert the specified field to the specified data through the switch case, in this way, data can be directly obtained on the page, and the function is initially implemented.

But another problem arises. It is the time for filtering in the front of the page. Because the data is displayed as "success", but the actual query is "S", it is stored in the data format, so on the page, the query data we use is always unable to be queried in the background. I thought that if the data saved in the database is also the format I need "success", then we can directly query it, so the view is used. When SQL is used to query data,

Use the case field when data then data end to directly convert the data to the desired format.

 

In the development process, especially when presenting data, we can consider using views and concatenate the data we need using simple SQL statements. views are not usually used, this should be frequently used, especially when using the Kendo UI, paging is implemented by Kendo, and using views is a medium and efficient method.

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.