| 发表于:2007-10-27 11:23:28 楼主 |
我写的代码如下: aspx代码: <asp:buttoncolumn text="<img border=0 alt='删除' src=../index/images/delete.gif>" headertext="删除" buttontype="linkbutton" headerstyle-forecolor="#ffffff" commandname="delete_click" /> aspx.vb代码: protected sub delete_click(byval sender as object, byval e as system.web.ui.webcontrols.datagridcommandeventargs) dim strid = e.item.cells(0).text dim myconn as oledbconnection, mycmd as oledbcommand, mysql as string myconn = new oledbconnection(configurationmanager.appsettings("accessstring") & system.web.httpcontext.current.server.mappath(configurationmanager.appsettings("database"))) myconn.open() mysql = "delete * from equipment where c_id=" & strid mycmd = new oledbcommand(mysql, myconn) mycmd.EXECutenonquery() myconn.close() end sub 请各位高手帮忙 |
|
|
|
|