
c#程序修改ACCESS数据库数据 update语句出错 请高手解决!!!!
main_window_command=newOleDbCommand("updatecombox_contentsettext='ss'wheremark='repre...
main_window_command = new OleDbCommand("update combox_content set text = 'ss' where mark = 'represent_list_A' and number = '2'", main_window_database);
main_window_command.ExecuteReader();//这句出错。 展开
main_window_command.ExecuteReader();//这句出错。 展开
1个回答
展开全部
text是关键字,以后不要再在数据库中用这个做为字段名,关键字用作字段名的时候要加[],即
update combox_content set [text] = 'ss'
update combox_content set [text] = 'ss'
追问
那我读的时候怎么没有出错呢?不过谢谢你的回答 帮我解决了问题。
追答
读的时候sql可能能认出那是关键字做字段用了,所以没错。但不管怎么说,在任何数据库中用关键字做字段名都不是好习惯
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询