| 发表于:2007-01-10 20:11:122楼 得分:0 |
界面一: oracleconnection css = dbEXECute.mainform_load(); this.com = css.createcommand(); com.commandtext = "select * from table1 where user_name = ' "+usernametext.text.trim()+ " ' and password = ' "+passwordtest.text.trim()+ " ' "; string rs = (string)com.EXECutescalar(); if(rs!=null) { css.close(); console.writeline( "恭喜,登陆成功 "); this.hide(); form2 f2 = new form2(); f2.showdialog(); this.dispose(); } else { messagebox.show( "您输入的用户名或密码有误 "); } 界面2: oledbconnection con = new oledbconnection( "provider=oraoledb.oracle.1;data source=crds;user id=automobile;password=automobile; "); oledbdataadapter sda = new oledbdataadapter( "select user_name 用户名,password 密码,name 姓名 from table1 where rownum <=10 ", con); dataset ds = new dataset(); sda.fill(ds, "tabletaxt "); this.datagrid1.datasource = ds.tables[ "tabletaxt "]; 本人是个菜鸟 ,代码请多多指点 | | |
|