編程中如何用DataAdapter操作Access數據表記錄?
使用OleDb下的Connection、Command、DataAdapter和CommandBuilder oledbconnection conn = new oledbconnection(); conn.connectstring = "your connection string"; oledbcommand cmd = conn.createcommand(); cmd.commandtext = "your SELECT command"; oledbdataadapter da = new oledbdataadapter(cmd); commandbuilder cb = new commandbuilder(da); dataset ds = new dataset(); //da 會自動打開連接 da.fill(ds); /* operations on ds */ da.update(ds); conn.close(); //release resources