TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mohamad guntur
NA
40
40.5k
How to delete current row in DataGridView?
Oct 2 2012 2:54 AM
i have an error when using this function,,i want to delete the data at the current rows. Of course when i'm deleting the rows, the selected data on the database must be deleted.
here is my code
Try
If Not con.State = ConnectionState.Open Then
con.Open()
End If
Dim cmd As New SqlCommand
cmd.Connection = con
cmd.CommandText = "DELETE FROM PRODUCT WHERE ID_PRODUCT=" & Me.DataGridView1.CurrentRow.Cells(0).Value & "'"
cmd.ExecuteNonQuery()
Finally
con.Close()
End Try
thanks in advance
Reply
Answers (
2
)
invalid expession term '.'
check checkbox in datagridview is checked or not