i have a question regarding datagrid,i have a datagrid that reads from sql table and i want to know how to display a value from a cell(groupid) into a label at the same page or when moving to another linked page ....here is my code
---------------------------------
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<HTML>
<script language="
VB" runat="server">
Sub Page_Load(Source as Object, e as EventArgs)
if not Page.IsPostBack then
BindData
End If
End Sub
Sub BindData()
Dim strConn as string = "data source=lfr;uid=asw;pwd=;database=w"
Dim sql as string = "Select username, password1, groupId from member"
Dim conn as New SQLConnection(strConn)
Dim Cmd as New SQLCommand(sql, conn)
Dim myreader as SQLDataReader
conn.Open()
myreader=cmd.executereader()
datagrid1.datasource=myreader
datagrid1.databind()
conn.Close()
End Sub
Sub Item_Created(sender As Object, e As DataGridItemEventArgs)
Label1.Text = Label1.Text & " " & e.item.ItemIndex
End Sub </script>
<form runat="server">
<asp:datagrid id="DataGrid1" runat="server"></asp:datagrid>
<P> </P>
<P><asp:label id="Label1" runat="server"></asp:label></P>
<P> </P>
</form>
</HTML>