往数据库里插入一条数据,不知哪里错了。联接数据库以后
oleconnection.open
olecommand.Connection=oleconnection
myCommand=new oledbCommand("insert into yonhu(username,paassword) values(user.text,pass.text)",oleconnection)
myCommand.ExecuteNonQuery()
myCommand=nothing
oleconnection.close
oleconnection=nothing
oleconnection.open
olecommand.Connection=oleconnection
myCommand=new oledbCommand("insert into yonhu(username,paassword) values(user.text,pass.text)",oleconnection)
myCommand.ExecuteNonQuery()
myCommand=nothing
oleconnection.close
oleconnection=nothing
解决方案 »
- 64位操作系统能否使用 Microsoft.ACE.OLEDB.12.0 查询2003及以下的 Excel
- Visual Stduio 2010 不错啊,速度快多了!不过好像就可以用.NET 4.0来开发,没有2.0、3.0、3.5这些以前的版本呢?
- 高手们救命!
- <a>标签显示文本的问题
- 多次调用一个类的时候出现重复,请帮忙看看,多谢!
- 如何实现论坛中的新帖提示功能?
- 想学ASP.NET(C#),是不是先要学C#呢?
- 郁闷~~~~~ VS.NET下无法调试ASP.NET应用程序!
- 看的书多了,有关控件的几个概念有什么区别?
- EF 和 dbhelper 结合在一起使用
- 还是关于权限的
- asp.net&C#中怎么找到控件设置属性
正如一楼所写。。
user.text,pass.text是变量。。要不然你的SQL语句就变成了
insert into yonhu(username,paassword) values(user.text,pass.text)
正如一楼所写。。
user.text,pass.text是变量。。要不然你的SQL语句就变成了
insert into yonhu(username,paassword) values(user.text,pass.text)
myCommand = new OleDbCommand(strCmd,oleConnection);
这样简单明了,给分吧