当前位置:网站首页>C language and SQL Server database technology
C language and SQL Server database technology
2022-07-25 14:24:00 【yushang_ zhang】
Use ADO.NET Query and manipulate data
One 、StringBuilder Use
1. The string itself is immutable , String concatenation builds multiple objects , Waste resources
2.StringBuilder It can be directly operated on the string itself , More efficient
3.StringBuilder Object construction :
a、Length length
b、Append(str) Append string
c、AppendFormat(str,params...) Appending a string with a specific format
Insert(index,str) Insert the specified string in the specified position
Remove(startIndex,endIndex) Delete the string of the specified interval
5. take StringBuilder Convert to string , You can call ToString() Method
6. If there are not many string operations , You can use it directly String It's more convenient
Two 、 Use ExecutNonQuery Complete the update operation
1.ExecutNonQuery() Used to perform update operations , Include increase 、 Delete 、 modify
2. The return is int Type the results , Represents the number of rows affected
3. You can judge whether the execution is successful by the number of affected lines
3、 ... and 、DataReader Use
1. Use DataReader You can query the data of the database
2.DataReader Used to retrieve read-only from a data source 、 Only incoming data flow
3.DataReader Only one record can be extracted from the data source at a time
4. operation SQL Server The database USES SqlDataReader
5.DataReader Common methods :
a、HasRows()
b、Read() Read down one line , Judge whether there is data , return true or false
c、Close() close
6.DataReader Used up need Close()
7. adopt SqlCommand Object's ExeuteReader() Method to get DataReader object
8. Only one cell in one row can be read at a time :
a、 Read according to the subscript of the cell dataReader[0]
b、 Read according to the column name of the cell dataReader['stuAge']
边栏推荐
- swiper 一侧或两侧露出一小部分
- Nuc980 set up SSH xshell connection
- 机械制造业数字化新“引擎”供应链协同管理系统助力企业精细化管理迈上新台阶
- A small part is exposed on one or both sides of the swiper
- NAT/NAPT地址转换(内外网通信)技术详解【华为eNSP】
- Hyperautomation for the enhancement of automation in industries
- 基于redis的keys、scan删除ttl为-1的key
- Bond0 script
- 【cartographer_ros】八: 官方Demo参数配置和效果
- Why do China Construction and China Railway need this certificate? What is the reason?
猜你喜欢

From Anaconda to tensorflow to jupyter, step on the pit and fill it all the way

实现一个家庭安防与环境监测系统(二)

Melodic + Realsense D435i 配置及错误问题解决

Feiwo technology IPO meeting: annual revenue of 1.13 billion Hunan Cultural Tourism and Yuanli investment are shareholders

NUC980 设置SSH Xshell连接

Oka pass rights and interests analysis is the best choice to participate in okaleido ecological construction

Matplotlib data visualization three minutes entry, half an hour enchanted?

Comprehensive sorting and summary of maskrcnn code structure process of target detection and segmentation

maya建模练习

CDA level Ⅰ 2021 new version simulation question 1 (with answers)
随机推荐
Paddlenlp's UIE relationship extraction model [executive relationship extraction as an example]
Comprehensive sorting and summary of maskrcnn code structure process of target detection and segmentation
Okaleido生态核心权益OKA,尽在聚变Mining模式
Teach you how to apply for SSL certificate
OverTheWire-Natas
Filters get the data in data; Filters use data in data
Goldfish rhca memoirs: cl210 management storage -- object storage
Leetcode 205. isomorphic string (2022.07.24)
Interpretation of featdepth self-monitoring model for monocular depth estimation (Part 2) -- use of openmmlab framework
【口才】谈判说服技巧及策略
sqli-labs Basic Challenges Less11-22
telnet远程登录aaa模式详解【华为eNSP】
Runtimeerror: CUDA out of memory (solved) [easy to understand]
Goldfish rhca memoirs: cl210 managing storage -- managing shared file systems
新唐NUC980设置DHCP或者静态IP
sudo rosdep init Error ROS安装问题解决方案
关于左值和右值的一些问题总结[通俗易懂]
2271. Maximum number of white bricks covered by blanket ●●
牛客多校 E G J L
快速搭建Dobbo小Demo