<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" borderwidth="1px" bordercolor="Black" xmlns:asp="#unknown">
<rowstyle cssclass="RowStyle" backcolor="#C9C9C9" horizontalalign="Center" font-names="Calibri" forecolor="Black" />
<headerstyle cssclass="HeaderStyle" backcolor="#4DB4EE" horizontalalign="Center" font-names="Calibri" forecolor="Black" />
<columns>
<asp:boundfield datafield="database column" headertext="abc" sortexpression="abc" />
<asp:boundfield datafield="database column" headertext="xyz" sortexpression="xyz" />
</columns>
</asp:gridview>
<asp:button id="Button1" runat="server" text="Update" onclick="Button1_Click" />
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["connectionstring name"].ConnectionString;
conn.Open();
string xyz=textbox1.text;
SqlCommand cmd = new SqlCommand("select * from tablename where name=@xyz", conn);
cmd.Parameters.Add(new SqlParameter("@xyz",xyz));
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}