As I Understood Ur Question
I Given Solution Like As Follows
<asp:textbox id="txt_Search" runat="server" width="200px">
<Button ID="btn_Search" runat="server" Text="Search" önclick="btn_Search_Click">
<br /><br />
<asp:textbox id="txt_Result" runat="server" textmode="MultiLine" width="200px" height="200px">
SqlConnection con = new SqlConnection("Ur Connection String");
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btn_Search_Click(object sender, EventArgs e)
{
try
{
con.Open();
string Query =
"Select UserName from Users Where UserName LIKE
'%" + txt_Search.Text + "%'";
SqlDataAdapter da = new SqlDataAdapter(Query, con);
DataTable DT = new DataTable();
da.Fill(DT);
txt_Result.Text = "";
for (int i = 0; i < DT.Rows.Count; i++)
{
txt_Result.Text += DT.Rows[i][0].ToString();
txt_Result.Text += " ";
}
if (txt_Result.Text == "")
txt_Result.Text = "No Result Found";
}
catch (Exception ex)
{
}
finally
{
con.Close();
}
}
Hope This WIll Help You