当前位置:网站首页>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']
边栏推荐
- Gartner 2022 top technology trend: Super automation
- 基于浏览器的分屏阅读
- ~4.2 CCF 2021-12-1 sequence query
- [original] nine point calibration tool for robot head camera calibration
- That day, I installed a database for my sister... Just help her sort out another shortcut
- Under the epidemic, the biomedical industry may usher in breakthrough development
- Structure size
- 飞沃科技IPO过会:年营收11.3亿 湖南文旅与沅澧投资是股东
- Jqgrid select all cancel single line click cancel event
- Practical guide for network security emergency response technology (Qianxin)
猜你喜欢

Okaleido ecological core equity Oka, all in fusion mining mode

Word set paste to retain only text

The main function of component procurement system, digital procurement helps component enterprises develop rapidly

IDEA设置提交SVN时忽略文件配置

What you must know about data engineering in mlops

Initial flask and simple application

Mysql表的操作

Keys and scan based on redis delete keys with TTL -1

PS making and loading GIF pictures tutorial

CDA level Ⅰ 2021 new version simulation question 1 (with answers)
随机推荐
Gartner 2022 top technology trend: Super automation
Throwing OutOfMemoryError “Could not allocate JNI Env“
The practice of depth estimation self-monitoring model monodepth2 in its own data set -- single card / multi card training, reasoning, onnx transformation and quantitative index evaluation
机械制造业数字化新“引擎”供应链协同管理系统助力企业精细化管理迈上新台阶
Day1: 130 questions in three languages
IDEA设置提交SVN时忽略文件配置
Opencv video tracking "suggestions collection"
Typora无法打开提示安装新版本解决办法
CTS test introduction (how to introduce interface test in interview)
关于ROS2安装connext RMW的进度条卡在13%问题的解决办法
优质数对的数目[位运算特点+抽象能力考察+分组快速统计]
Nuc980 set up SSH xshell connection
Development of uni app offline ID card identification plug-in based on paddleocr
Detailed explanation of Telnet remote login AAA mode [Huawei ENSP]
AI model risk assessment Part 1: motivation
OKA通证权益解析,参与Okaleido生态建设的不二之选
Sunfeng, general manager of Yixun: the company has completed the share reform and is preparing for IPO
金鱼哥RHCA回忆录:CL210管理存储--对象存储
CTS测试介绍(面试怎么介绍接口测试)
From Anaconda to tensorflow to jupyter, step on the pit and fill it all the way