Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
mports System.Data Imports System.Data.SqlClient Partial Class deletedisable Inherits System.Web.UI.Page Dim con As SqlConnection Dim Cmd As SqlCommand Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim constr As String = ConfigurationManager.AppSettings("con") con = New SqlConnection(constr) Cmd = New SqlCommand() Cmd.Connection = con If Not IsPostBack Then BindToGrid() End If End Sub Private Sub BindToGrid() Cmd = New SqlCommand("Select * from tbl1 ", con) Dim ds As New DataSet() Dim da As New SqlDataAdapter(Cmd) da.Fill(ds) DataGrid1.DataSource = ds Try DataGrid1.DataBind() Catch DataGrid1.CurrentPageIndex = 0 BindToGrid() End Try End Sub Protected Sub DataGrid1_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand Cmd = New SqlCommand("delete from tbl1 where id='" & DataGrid1.DataKeys(e.Item.ItemIndex) & "'", con) con.Open() Try Cmd.ExecuteNonQuery() Catch Response.Write("Nothing") End Try DataGrid1.EditItemIndex = -1 con.Close() BindToGrid() End Sub End Class
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.