C#写数据库4大操作

来源:百度知道 编辑:UC知道 时间:2024/05/30 04:02:17
C#写数据库4大操作是什么?最好能说“明白”。
让我看懂学会的必加分!!!

增,删,改,查
增:向数据库增加内容
语句:insert into table_name(column1,column2)value('"+txtbox1.text+"','"+txtbox2.text+"');
删:删除数据库的数据
语句:delete from table1 where id=@id(条件);

改:修改数据库的内容
语句:update table1 set column1=@column1;
查:查询数据库的数据,一般用户显示在前台;
select column1,column1 from table1 where 条件=@条件

增删改查 不会的语句M我问就行

增,删,改,查。

insert
update
select
delete

增 删 改 查

1.查询语句:
"select * from 数据表 where 字段名=字段值 order by 字段名 [desc]"
"select * from 数据表 where 字段名 like '%字段值%' order by 字段名 [desc]" 模糊查询
"select top 10 * from 数据表 where 字段名 order by 字段名 [desc]"
"select * from 数据表 where 字段名 in ('值1','值2','值3')".
"select * from 数据表 where 字段名 between 值1 and 值2"
2.修改语句:
"update 数据表 set 字段名=字段值 where 条件表达式"
"update 数据表 set 字段1=值1,字段2=值2 …… 字段n=值n where 条件表达式"