当前位置:网站首页>A solution of C batch query
A solution of C batch query
2022-04-23 21:26:00 【Plant a sweet smell】
Business background :
Often receive similar needs from customers , The customer gave the internal staff of the company a excel, After that, you need to query the binding data or packaging data of the assembly line , There is no good interface for users to query
Solution :
1. Write SQL Script , Start splicing SQL, After that, it takes time and effort ;
2. The characters used in the text input box in the program are limited , about 5 More than 10000 data are powerless ;
New solution :
SqlSugar(ORM)+NPOI+sqlBulk( For big data (10 More than ten thousand ) Under the circumstances )
advantage :
1.SqlSugar(ORM) Provides an interface to interact with the database , And it's good to avoid sql Injection and sql error ; It's really quick to get started , Basically, if you look at the official documents and examples, you can almost ; this ORM It's open source. , quite a lot .NET All the big factories are using
SqlSuagr Official website address :http://www.codeisbug.com/Home
2.NPOI Provides operation methods for documents , And avoid not installing Microsoft excel The embarrassment of the special version , The specific packaging method is shown in MESCommon
3.sqlbulk Provide for the right to excel Operation of document mass data , Insert 100 10000 pieces of data to the database takes about 30S;
Compare the performance of mass data operations :
Code demo address :https://blog.csdn.net/baidu_29047977/article/details/90515682
3.SqlSugar It's a very useful Orm frame , In some performance , Better than Microsoft's EF The framework is also superior
matters needing attention
1. For operations with large data , Try not to use For loop ;
2. For batch query of data , Try to use the middle table ;
版权声明
本文为[Plant a sweet smell]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/110/202204200619556909.html
边栏推荐
- Deep analysis of C language function
- Graph traversal - BFS, DFS
- Reentrant function
- Chrome 94 引入具有争议的 Idle Detection API,苹果和Mozilla反对
- Pytorch preserves different forms of pre training models
- Automatic heap dump using MBean
- Lunch on the 23rd day at home
- thinkphp5+数据大屏展示效果
- Explore ASP Net core read request The correct way of body
- FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app:stripDe
猜你喜欢
亚马逊和Epic将入驻,微软应用商城向第三方开放
CUDA, NVIDIA driver, cudnn download address and version correspondence
Rust更适合经验较少的程序员?
Thinkphp5 + data large screen display effect
[leetcode refers to offer 52. The first common node of two linked lists (simple)]
Yolov5 NMS source code understanding
[leetcode refers to offer 32 - III. print binary tree III from top to bottom (medium)]
Chrome 94 introduces the controversial idle detection API, which apple and Mozilla oppose
Prim、Kruskal
随机推荐
Pytorch preserves different forms of pre training models
Detectron2 using custom datasets
Introduction to tensorrt
Oracle updates the data of different table structures and fields to another table, and then inserts it into the new table
Common problems in deploying projects with laravel and composer for PHP
Tensorflow and pytorch middle note feature map size adjustment to achieve up sampling
Win 11K in 100 days, super complete learning guide for job transfer test
Unit function expansion
[leetcode refers to offer 42. Maximum sum of continuous subarrays (simple)]
How to make Jenkins job run automatically after startup
Chrome 94 introduces the controversial idle detection API, which apple and Mozilla oppose
Two Stage Detection
Getting started with detectron2
Lunch on the 23rd day at home
[leetcode refers to offer 18. Delete the node of the linked list (simple)]
presto on spark 支持3.1.3记录
Preliminary analysis of Airbase
Centos7 builds MySQL master-slave replication from scratch (avoid stepping on the pit)
Thinkphp5 + data large screen display effect
Sequential state