hi
in default.aspx page I put gridview ,button and text box
and bind grid view from database...
private void ViewUsersInfo()
{
DataTable dt = DummyDataTable();
using (SqlConnection conn = General.GetConnection())
{
using (SqlCommand _cmd = General.GetCommand("ViewphoneInfo", conn))
{
conn.Open();
SqlDataReader _dr = _cmd.ExecuteReader();
if (_dr.HasRows)
{
GridView1.DataSource = _dr;
GridView1.DataBind();
}
}
}
}
and:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField ItemStyle-Width="200px" ItemStyle-VerticalAlign="Middle" ShowHeader="False">
<ItemTemplate>
<asp:Label ID="LblName" runat="server" Text='<%#Eval("Number")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="Button7" runat="server" Text="Button" OnClick="Button7_Click" />
<asp:TextBox ID="Txttest" runat="server"></asp:TextBox>
I want when I click on button7 it will put all data from gridview into textbox...
How I can do it?
Best regards
neda