thanx for ur reply rayan, I tried looking at ur examples but i couldnt find a way out. Iam new to .net and currently working on a project which was coded by a different person. This is what the grid looks like and i would be waiting for ur reply
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AllowPaging="True" PageSize="15" OnPageIndexChanging="GridView1_PageIndexChanging" AllowSorting="True" >
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EBEBEB" />
<EditRowStyle BackColor="#7C6F57" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#0A4A13" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#0A4A13" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:TemplateField HeaderText="ID">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="UL">
<EditItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("UL") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("UL") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="LAST_NAME" HeaderText="Last N" SortExpression = "LAST_NAME" />
<asp:BoundField DataField="FIRST_NAME" HeaderText="First N" SortExpression = "FIRST_NAME"/>
<asp:BoundField DataField="DATE" HeaderText="Date Registered" SortExpression = "DATE"/>
</Columns>
</asp:GridView>
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.SelectedRow;
Label lblID = row.FindControl("Label1") as Label;
Label lblUL = row.FindControl("Label2") as Label;
Session["myID"] = lblID.Text;
Session["myUl"] = lblUL.Text;
string strFullname = Session["userFname"].ToString() + " " + Session["userLname"].ToString();
DateTime today = DateTime.Now;
string strDateLastViewed = today.ToString();
sql mySqlQuery = new sql();
mySqlQuery.queryDbVoid("UPDATE USED_LOG SET LAST_VIEWED_BY = '" + strFullname + "', DATE_LAST_VIEWED = '" + strDateLastViewed + "' WHERE (" + "UL = '" + lblUL.Text + "') AND " + "(ID = '" + lblID.Text + "')", ref lblResultsError);
Response.Redirect("summary.aspx");
}//END GridView1_SelectedIndexChanged
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
dataBind(Session["myQuery"].ToString());
}