Question: I want to get distance text from following link. i have used NSXML parsing but unable to get the result. please tell me which xml method should i used for following xml. 

<http://maps.googleapis.com/maps/api/directions/xml?origin=30.9165904,75.8634752&destination=30.89314000,75.86938000&sensor=true>

Thanks to all

Answer: 
Grid view can be really powerful if used correctly, one of the things you can do is hook onto an event (on data row bound) which will allow you to manipulate each row at a time. 

ASP.NET is more event driven than PHP, however if you still want to do things the PHP way you could in theory loop through each result. 

```
  using (
           var oConn =
               new SqlConnection(
                   ConfigurationManager.ConnectionStrings["myConnectionStringNameFromWebConfig"].ConnectionString)
           )
        {
            oConn.Open();
            using (SqlCommand oCmd = oConn.CreateCommand())
            {
                oCmd.CommandType = CommandType.StoredProcedure;
                oCmd.CommandText = "p_jl_GetThemeForPortal";
                oCmd.Parameters.Add(new SqlParameter("@gClientID", clientID));
            }

             using(var oDR = oCmd.ExecuteReader())
                {
                    while(oDR.Read())
                    {
                        string x = (string)oDR["ColumnName"];
                        int y = (int) oDR["ColumnName2"];
                        // Do something with the string and int
                    }
                }

        }

```

This pattern (by using using statements) ensures your connections are closed at the end of each fetch sequence, so you don't have lots of open DB connections kicking around
example aspx:

```
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
    <Columns>
        <asp:BoundField DataField="CountryID" HeaderText="ID" ItemStyle-HorizontalAlign="Center" />
        <asp:TemplateField HeaderText="Flag" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <img src='<%# "img/flags/" + Eval("CountryFlag").ToString()%>' alt="flag" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="CountryName" HeaderStyle-HorizontalAlign="Left" HeaderText="Name" ItemStyle-CssClass="dg_title"/>
        <asp:TemplateField HeaderText="VAT" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%# CheckBool(Convert.ToBoolean(Eval("CalculateVat"))) %>
            </ItemTemplate>
        </asp:TemplateField>  
        </Columns>
</asp:GridView>

```

in the code behind the `CheckBool` is a function I have made:

```
public string CheckBool(bool toCheck)
{
    if (toCheck)
        return "<img src=\"img/checked.png\" alt=\"Yes\" />";
    else
        return "<img src=\"img/deleted.png\" alt=\"No\" />";
}

```

and in the `Page_Load`

```
protected void Page_Load(object sender, EventArgs e)
{
    GridView1.DataSource = SsUtils.GetCountries();
    GridView1.DataBind();        
}

```

`SsUtils` is a static class and the `GetCountries` returns a `List<Country>` which is a collection of the class country. But you can also use a `DataSet` or `DataTable` as datasource for your gridview.

This is just a sample, to show some possibilities. You can also have edit buttons, paging, sorting etc. with a gridview.