As mentioned by ppolymorphe your code has an issue with SQL injection and you need to update code for that one.
Considering your question you can try something below - if you have any matching record you will receive it back with database call otherwise you will simply return nothing, so check the size of records you get back as below.
if (txtslipno.Text.Trim() != "")
{
SqlCommand cmd = new SqlCommand("select * from Sample where Slipno = '" + textbox1.Text + "'", con);
con.Open();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
da.SelectCommand = cmd;
da.Fill(ds);
if(ds.Tables != null && ds.Tables[0].Rows.Count > 0)
{
grdRpt.DataSource = ds;
grdRpt.DataBind();
}
else
{
}
con.Close();
}