Nitesh Gautam

Nitesh Gautam

  • NA
  • 6
  • 503

how to serch data from this gridview

Feb 7 2017 2:35 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Managers.aspx.cs" Inherits="WebApplication1.Managers" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Search:
<asp:TextBox ID="txtSearch" runat="server" />
<asp:Button Text="Search" runat="server" OnClick="Search" Height="23px" />
<hr />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:login1ConnectionString %>" SelectCommand="SELECT * FROM [Data]"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID"></asp:BoundField>
<asp:BoundField DataField="UserName" HeaderText="UserName" SortExpression="UserName"></asp:BoundField>
<asp:BoundField DataField="Password" HeaderText="Password" SortExpression="Password"></asp:BoundField>
<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email"></asp:BoundField>
<asp:BoundField DataField="Age" HeaderText="Age" SortExpression="Age"></asp:BoundField>
<asp:BoundField DataField="Fname" HeaderText="Fname" SortExpression="Fname"></asp:BoundField>
<asp:BoundField DataField="Mname" HeaderText="Mname" SortExpression="Mname"></asp:BoundField>
<asp:BoundField DataField="Countact" HeaderText="Countact" SortExpression="Countact"></asp:BoundField>
<asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address"></asp:BoundField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>

Answers (1)