During the development process, we found some useful experiences through data query:
1. Compared with the previous for statement foreach, foreach has a better execution efficiency. The average time spent by foreach is only 30% of that of. When both for and foreach can be used through the test results, we recommend using a more efficient foreach. In addition, the write time using for is about 10 times the read time;
2. In Asp.netProgramUsing the SA account is very insecure. It has the permission to perform any operations on the database. Hackers can call extended stored procedures like xp_mongoshell to launch attacks;
3. When processing data interactions, try to put the processing of SQL statements in the middle layer (such as specialized data operations and stored procedures), which is an effective way to prevent injection attacks;
4. Avoid unnecessary round-trip to the server. Use Page. ispostback to avoid unnecessary operations on the round-trip process;
5. You must disable the debugging mode;
6. Generally, sqldatareader is used to read a large amount of data and not process the returned data in large quantities. datset is suitable for handling large amounts of returned data. the selection of sqldatareader and dataset depends on the implementation of program functions;
7. We recommend that you use <% # ctype (container. dataitem, datarowview). Row ("field name") %> for data binding. When the data volume is large, the speed can be increased by several hundred times;
Welcome to communicate with me! You are welcome to give your comments!