Dataview does not use new for initialization.

Source: Internet
Author: User

Recently, it is found that when the order browsing screen is opened, the system will throw an error message indicating that there is no data in the 0 rows. It is a search condition problem in the beginning,

In addition, the number of times of appearance is relatively small, there is no regularity, and there is no great impact on system operations, so there is no special care. However, today, it happened to pass the pipeline.

The error can be reproduced in this way, so I decided to find out the reason. Through step-by-step tracking, we find that every time we use dataview

New is not used for initialization. After each declaration, the value is assigned directly through dataview DV = DT. defaultview;

After DV is used, set DV. rowfilter = "***".

As a result, I found that DV. rowfilter has been assigned a value when I followed dataview DV = DT. defaultview,

It is strange that the data shows that since the memory is not re-allocated to dataview, the system has directly allocated the dataview memory in other images.

(Dataview declares the same names in these images), so it is not surprising that the DV. rowfilter value has been assigned.

The strange bug is also solved. Therefore, after declaring an object in. net, we should first create a new object and then assign a value to prevent such a bug.

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.