oleStr5 ="insert into [student]([]) values(@paramMark) where id=@id and tid=@tid";SqlCommand1.Parameters.AddWithValue("@paramMark", ); SqlCommand1.Parameters.AddWithValue("@id", id); SqlCommand1.Parameters.AddWithValue("@tid", ds.Tables[0].Rows[0]["id"]);SqlCommand1为SqlCommand对象名称。
insert into where?这个语法有问题吧 oleStr5="update student set ="+m+"where id="+sid+"and tid="+ds.Tables[0].Rows[0]["id"].ToString();
LZ是想修改数据库中的数据么?怎么用insert into …… where ……啊? update …… where…… 另外 用单引号 ds.Tables[0].Rows[0][‘id’] +"";
1。想修改 字段值 用 update 表名 set 字段=值 Where 条件 2。想从一个表中 取值 插入另一个表中 用 insert into A表 (字段) select 字段 from B表 where 条件 3。从A表中 取值 创建 B表 用 select 字段 into B表 from A表 where 条件
insert into xxx select from xxxx where
oleStr5 ="insert into (student, ) values(" + m + ") where id="+ sid +" and tid="+ ds.Tables[0].Rows[0]["id"] +"";这样行不行
SqlCommand1.Parameters.AddWithValue("@id", id);
SqlCommand1.Parameters.AddWithValue("@tid", ds.Tables[0].Rows[0]["id"]);SqlCommand1为SqlCommand对象名称。
oleStr5="update student set ="+m+"where id="+sid+"and tid="+ds.Tables[0].Rows[0]["id"].ToString();
update …… where……
另外 用单引号 ds.Tables[0].Rows[0][‘id’] +"";
2。想从一个表中 取值 插入另一个表中 用 insert into A表 (字段) select 字段 from B表 where 条件
3。从A表中 取值 创建 B表 用 select 字段 into B表 from A表 where 条件
insert into 语法哪里有问题?