本文介绍了vb.net和sql标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助im新手编程即时使用vb.net和sql
i想要突出显示青色的值(1)删除我不想删除数据而不是我用来强调它作为vb.net中的删除方式,当我停止并重新运行程序突出显示的数据没有突出显示
这是我的代码:
please help im newbie in programming im using vb.net and sql
i want to highlight with color cyan the value (1) for deletion i dont want to delete data instead i use to highlight it as way of deletion in vb.net when i stop and re run again the program the highlighted data was unhighlighted
this is my code:
Private Sub dgvDoctorsList_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvDoctorsList.CellDoubleClick
If MessageBox.Show("Are you sure want to delete this data ?", "CONFIRMATION", MessageBoxButtons.YesNo, MessageBoxIcon.Information) = Windows.Forms.DialogResult.Yes Then
Dim objCmd As New SqlCommand()
Using con As New SqlConnection("server=ACHACOSOFAMILY;database=jjasgh;integrated security=true")
objCmd.Connection = con
con.Open()
For Each objRow As DataGridViewRow In dgvDoctorsList.SelectedRows
objCmd.CommandText = "Update tbl_Doctor SET Remarks=1 where License_no=@license"
objCmd.Parameters.AddWithValue("@license", dgvDoctorsList.CurrentRow.Cells(0).Value)
objCmd.ExecuteNonQuery()
objRow.DefaultCellStyle.BackColor = Color.Cyan
Next
End Using
End sub
con.Close()
任何人都可以帮我解决这类程序,感谢您的考虑提前感谢
can anyone help me in this kind of program thanks for consideration thanks in advance
推荐答案
这篇关于vb.net和sql标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!