SQL statement CRUD

 

SQL statement CRUD

Table Design:

 

insert into tb_ceshi (Name,Content) values ('李钊','11111111')

update tb_ceshi set Content='22222222222' where Name='李钊'

delete from tb_ceshi where Name='李钊'

 

Note : stitching in the background when the SQL statement, and pay attention to converting the character variables

 

Method 1: The parameter set of splicing sql

Background SqlParameter using parametric value pass over the splice, for example:

 

For another example:

 

When fewer parameters may be:

 

Method 2: parametric array splicing sql

 

 

 

Guess you like

Origin www.cnblogs.com/fzqm-lwz/p/11669450.html