Home | Contact Us | Download | Support | Purchase | Products


Product List
 
  "I purchased your product about a month ago and have been very impressed with your response to any questions I've had. Thank you."
Matt Savacool
 
More
Testimonies

Ping to a DataGrid

The following example demonstrates how to bind the results of a ping to a datagrid.

[C#]

private void Page_Load(object sender, System.EventArgs e)
{
	if( Page.IsPostBack )
	{
		string hostToPing = "www.yahoo.com";
		ReplyPacketCollection reply = IcmpClient.Ping( hostToPing, 4);
		DataGrid dg = new DataGrid();
		dg.DataSource = reply.ToDataTable();
		dg.DataBind();
		Page.Controls.Add( dg );
		
	}
}


[VB.NET]

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    If Page.IsPostBack Then
        Dim hostToPing As String = "www.yahoo.com"
        Dim reply As ReplyPacketCollection = IcmpClient.Ping(hostToPing, 4)
        Dim dg As New DataGrid()
        dg.DataSource = reply.ToDataTable()
        dg.DataBind()
        Page.Controls.Add(dg)
    End If

End Sub


 

 

 

 

 

 



The box is not shipped. aspNetPing is a downloadable product.