| 发表于:2007-02-06 22:15:13 楼主 |
private sub button1_click(byval sender as system.object, byval e as system.eventargs) handles button1.click dim connectionstring as string = "provider=microsoft.jet.oledb.4.0;data source= " & application.startuppath & "\users.mdb " dim getallsql as string = "select * from users " dim connection as new oledbconnection(connectionstring) dim adapter as new oledbdataadapter(getallsql, connection) dim cb_adapter as new oledbcommandbuilder(adapter) dim ds as new dataset connection.open() adapter.fill(ds, "users ") datagrid1.datasource = ds datagrid1.datamember = "users " dim dr as datarow = ds.tables( "users ").newrow() dr.item( "id ") = 7 ' ' '主键 dr.item( "user_name ") = " " dr.item( "password ") = " " dr.item( "real_name ") = " " dr.item( "tel ") = " " dr.item( "email ") = " " dr.item( "submit_date ") = "2007-2-5 " ds.tables( "users ").rows.add(dr) adapter.update(ds, "users ") end sub 错误提示:未处理的“system.data.oledb.oledbexception”类型的异常出现在 system.data.dll 中。 |
|
|
|
|