Tag : .NET, Ms SQL Server 2008, VS 2008 (.NET 3.x)
Date :
2014-05-07 15:57:41
By :
็Heroplayboy
View :
1781
Reply :
7
No. 1
Guest
Code (VB.NET)
Private Sub btnDel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDel.Click
If Me.DTVdata.Rows.Count = 1 Then Exit Sub
If MessageBox.Show("Are you sure you want to delete ?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
ds.Tables("table_name").Rows(Me.DTVdata.CurrentRow.Index).Delete()
ds.AcceptChanges()
End If
End Sub
private Sub button1_Click(object sender, EventArgs e)
{
Dim intRows As Byte = Convert.ToByte(grdResult.CurrentRow.Index)
grdResult.Rows.RemoveAt(intRows)
}