您的位置:程序门 -> .net技术 -> c#



各位真正的程序员,给我一个正确的答案___数据库操作(vs2005---c#)


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


各位真正的程序员,给我一个正确的答案___数据库操作(vs2005---c#)
发表于:2007-05-04 20:22:35 楼主
01:在2005中datagridview用table1bindingsource和bindingnavigator1连接好   但是增加和修改数据都不存进表里,怎么解决啊?
+++++++++++++++++++
02:string   conn   =   "   provider   =   microsoft.jet.oledb.4.0   ;   data   source   =   llld.mdb   ";
                        oledbconnection   df=new   oledbconnection(conn);
                        string   insert_text   =   "insert   into   first01(name,xb,date01,idname)   values( ' "   +   this.textbox1.text   +   " ', ' "   +   this.combobox1.text   +   " ', ' "   +   this.datetimepicker1.text   +   " ', ' "   +   this.textbox2.text   +   " ') ";
                        oledbcommand   fdf   =   new   oledbcommand(insert_text,   df);
                      df.open();
                      fdf.EXECutenonquery();
                      first01tableadapter.update(this.lllddataset.first01);
                        this.lllddataset.acceptchanges();
为什么插入数据后能在datagridview看到下次运行后什么也没有保存,根本就没有保存到数据库里,这是为什么呀,百思不解其得,大家给了个招吧



快速检索

最新资讯
热门点击