数据库里如何用update更改表内数据
答案:4 悬赏:70 手机版
解决时间 2021-03-31 03:46
- 提问者网友:謫仙
- 2021-03-30 20:28
数据库里如何用update更改表内数据
最佳答案
- 五星知识达人网友:北城痞子
- 2021-03-30 21:38
比如:
string sql = "update news set title=@title,body=@body where id=@id";
OleDbParameter[] para = new OleDbParameter[] {
new OleDbParameter("@title", txttitle.Text.Trim()),
new OleDbParameter("@body", this.body.Value.ToString()),
new OleDbParameter("@id",int.Parse(Request["id"].ToString()))
};
DBClass.ExecuteNonQueryCan(sql, para)
string sql = "update news set title=@title,body=@body where id=@id";
OleDbParameter[] para = new OleDbParameter[] {
new OleDbParameter("@title", txttitle.Text.Trim()),
new OleDbParameter("@body", this.body.Value.ToString()),
new OleDbParameter("@id",int.Parse(Request["id"].ToString()))
};
DBClass.ExecuteNonQueryCan(sql, para)
全部回答
- 1楼网友:往事埋风中
- 2021-03-30 23:24
update tbl_name set courseNo='A010001',courseGrade=82 where stuNo='2000070401';
update tbl_name set stuName='刘刚',sex='女',classNo='20010704' where stuNo='2000070401';
update tbl_name set stuName='刘刚',sex='女',classNo='20010704' where stuNo='2000070401';
- 2楼网友:末日狂欢
- 2021-03-30 22:54
UPDATE youtable set score = 82 where xuehao = '2000070401’and coursenum =‘A010001’
UPDATE youtable set name =‘刘刚’,sex = '女',classnum =‘20010704’
where xuehao = '2000070404'
UPDATE youtable set name =‘刘刚’,sex = '女',classnum =‘20010704’
where xuehao = '2000070404'
- 3楼网友:轮獄道
- 2021-03-30 22:33
UPDATE 表1 set 成绩 = 82 where 学号 = 2000070401’and 课程编号 =‘A010001’
UPDATE 表1 set 姓名 =‘刘刚’,性别 = '女',班级编号 =‘20010704’
where 学号 = '2000070404'
UPDATE 表1 set 姓名 =‘刘刚’,性别 = '女',班级编号 =‘20010704’
where 学号 = '2000070404'
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯