try
{
string strConnString = ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;
SqlConnection con = new SqlConnection(strConnString);
DataTable dt = new DataTable();
using (SqlConnection conn = new SqlConnection(strConnString))
{
string strQuery = "SELECT * FROM TDLoanRate where LoanType Like'%" + txtValue.Text + "%' ";
SqlCommand cmd = new SqlCommand(strQuery);
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
conn.Open();
sda.SelectCommand = cmd;
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
how do i check if there are no rows which has been searched and return a mesage