Hi Micah ,its so simple . try my code
use Northwind ms sql database .
Html Code
<div>
<script type="text/javascript">
function RefreshUpdatePanel() {
__doPostBack('<%= Code.ClientID %>', '');
};
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
Search:<asp:TextBox ID="Code" runat="server" onkeyup="RefreshUpdatePanel();" placeholder="Search Whole Product..." AutoPostBack="true" OnTextChanged="Code_TextChanged"></asp:TextBox>
<asp:UpdatePanel ID="Update" runat="server">
<ContentTemplate>
<asp:GridView ID="gvCustomers" runat="server" ShowHeader="false" CssClass="table table-bordered"
RowStyle-CssClass="rowHover" AutoGenerateColumns="false"
>
<Columns>
<asp:TemplateField >
<ItemTemplate>
<asp:Label ID="lblid" Font-Bold="true" runat="server" Text=' <%#Eval("ProductID") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemTemplate>
<asp:Label ID="lblname" Font-Bold="true" runat="server" Text=' <%#Eval("ProductName") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemTemplate>
<asp:Label ID="lblmrp" Font-Bold="true" runat="server" Text=' <%#Eval("QuantityPerUnit") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Code" />
</Triggers>
</asp:UpdatePanel>
</div>
c# code
Namespace
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
code on textbox changeed event
protected void Code_TextChanged(object sender, EventArgs e)
{
if (Code.Text != "")
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ErpConnection"].ConnectionString);
conn.Open();
SqlCommand cmd = new SqlCommand("Select * from Products where [ProductName] LIKE @SearchTerm1 + '%'", conn);
cmd.Parameters.AddWithValue("@SearchTerm1", Code.Text.Trim());
SqlDataAdapter adp = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adp.Fill(ds);
gvCustomers.Visible = true;
gvCustomers.DataSource = ds;
gvCustomers.DataBind();
gvCustomers.Focus();
Code.Focus();
}
else
{
gvCustomers.Visible = false;
Code.Focus();
}
}