-
private sub mshfgrid_click()
end sub
if msgbox("Are you sure the deletion number is: [.]" & "] ?", vbquestion + vbyesno, "Delete") = vbyes then
set resdel = new
delete from userinfo where userid='" & "'", conn, 1, 2
msgbox "Deleted successfully! ", vbinformation, "Success"
if <>0 then
select * from viewuserinfo", conn, 1, 1
set = resdel
if <>0 then
set resdel = nothing
end if
If there's anything you don't understand, you can ask me again.
-
Ideas. Create the data written to datagrid1 into a zero-hour table.
When writing from a zero-time table to datagrid1, the selected row of data is deleted from the zero-time table.
Data is written to datagrid1.
-
Here are the delete buttons**. rec to define. dim rec as new recordset
if < 1 then
msgbox ("No data information found, please confirm! ")vbokonly, "Wrong"
exit sub
elseif msgbox("Data deletion is irreversible, please confirm! ",vbyesno) =vbyes then
end if
end if
-
Double-click a row in DataGrid to get the value of a field in the current row (one of the cells: that is, the field corresponding to your database, how do you set which field in this column is the first field). To display this value, use:
Your field name may be an ordinal number starting with 0")
-
Upstairs probably won't, you want"Double-click",It seems that it can only be implemented with js.,Upstairs is all on the server side**,Okay?
-
dim myconn as
myconn = new
strcon
dim del as oledbcommand = new oledbcommand(sqldel, myconn)
Then it's OK to help the top datatable display again.
-
Your variable name st0 is declared in command1 click(), so how can it be identified in command2 click()?
Modify it as follows: private st0 as new'Define a stordext object.
private sub command1_click() 'Inquire.
dim cn as new 'Define a database object.
dim sl as string
provider=;persist security info=false;user id=sa;initial catalog=xiewei;data source=pc-20110605tmui"
sl = "select * from xwuser "
sl, cn, adopenkeyset, adlockoptimistic
set = st0
end sub
private sub command2_click() 'Delete
end sub
Note: Deleting a record is not required.
-
Add a text box name on the click event in the datagrid. text=ado control name. recordset("The name of the field"This will complete your request and explain why, because when the datagrid makes a click selection, the current record will be moved to the data row you clicked, so you can directly display it directly with the text attribute of the text box, of course, you have to bind the data control before displaying, otherwise it will not be displayed!
It is also possible to report an error binding data control statement, as shown in the following set text box name. datasource=ado control name.
-
For bound data. If there are multiple rows, please cycle through the process.
datarowview drv = as datarowview;
When you update the selected row of the bound datatable, the corresponding row of the db is also deleted.
Or; Remove the rows to be deleted without affecting the database when updating.
At last; Non-binding, only.
Can.
It's pretty big, but if you're a beginner, it's nothing, and it's going to change quickly at the beginning.
It should be the declaration of a control on your form twice, for example, you have changed the name of a control first, and double-click on the control to bring up a private sub. ', and then you change the name of the event under that control in the original program, and I ran into this problem.
VisualFreeBasic understands what VB6 should be put in the museum, and what VBNET should be able to eat dust.
private declare function immgetdescription lib "" _
alias "immgetdescriptiona" (byval hkl as long, _ >>>More
Intact? You go and plant an MSDN It's a help document Just this document has 1 G.,How can we send you a complete Ah There are a lot of VB MSDN on the Internet **It takes time or you look for whether there is an installation disk If there is, you can install it The msdn of the programming software is the most effective。