当前位置:网站首页>C reads excel specific data into specific columns of DataGridView
C reads excel specific data into specific columns of DataGridView
2022-04-23 21:25:00 【Plant a sweet smell】
C# Read Excel Specific data to DataGridView In a specific column of
1. Studying recently DataGridView Read Excel When , I found that I read more data every time , I didn't read what I wanted excel Column data , Baidu has not found what it wants . Then I was checking DataGridView When the column attribute of DataPropertyName This attribute .
2.DataPropertyName The attribute of means : Gets or sets the properties of the data source or the name and address of the database column DataGridView binding .
1. The interface operation binding is as follows :
Let the columns you add DataPropertyName And Excel Your column name is always ok
2. The code operation is as follows :
DataGridView And get Excel Of DataTable If the column properties of are consistent .
DataGridView.Columns["ColMac"].DataPropertyName = dt.Columns["MAC"].ColumnName;
There are many pits on the way to beginner's school , I hope these will help you . Encourage them together !
版权声明
本文为[Plant a sweet smell]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/110/202204200619557349.html
边栏推荐
- Pikachuxss how to get cookie shooting range, always fail to return to the home page
- [leetcode refers to offer 18. Delete the node of the linked list (simple)]
- Pyuninstaller package exe cannot find the source code when running, function error oserror: could not get source code
- Minecraft 1.12.2模组开发(四十三) 自定义盾牌(Shield)
- [※ leetcode refers to offer 48. The longest substring without repeated characters (medium)]
- Problem brushing plan -- dynamic programming (III)
- Use 3080ti to run tensorflow GPU = 1 X version of the source code
- 危机即机遇,远程办公效率为何会提升?
- How to make Jenkins job run automatically after startup
- ROS学习笔记-----ROS的使用教程
猜你喜欢
How to make Jenkins job run automatically after startup
Fastdfs mind map
MySQL basic collection
[leetcode refers to offer 18. Delete the node of the linked list (simple)]
Addition, deletion, modification and query of advanced MySQL data (DML)
thinkphp5+数据大屏展示效果
[leetcode sword finger offer 10 - II. Frog jumping steps (simple)]
Express ③ (use express to write interface and cross domain related issues)
Resolve the "chromedriver executable needs to be in path" error
Preliminary analysis of Airbase
随机推荐
Sequential state
[leetcode refers to offer 22. The penultimate node in the linked list (simple)]
[leetcode refers to offer 32 - III. print binary tree III from top to bottom (medium)]
Introduction to tensorrt
Sharpness difference (SD) calculation method of image reconstruction and generation domain index
在线Excel转CSV工具
[leetcode refers to the substructure of offer 26. Tree (medium)]
Question brushing plan -- backtracking method (I)
IOT design and development
Common commands of MySQL in Linux
Pytorch: runtimeerror: an attempt has been made to start a new process Error reporting (resolved)
Is rust more suitable for less experienced programmers?
阿里又一个“逆天”容器框架!这本Kubernetes进阶手册简直太全了
CUDA, NVIDIA driver, cudnn download address and version correspondence
[leetcode refers to offer 47. Maximum value of gift (medium)]
Deep analysis of C language pointer (Part I)
如何发挥测试策略的指导性作用
[※ leetcode refers to offer 32 - II. Print binary tree II from top to bottom (simple)]
Selenium displays webdriverwait