shibasankar behera

shibasankar behera

  • NA
  • 117
  • 101.2k

search from gridview in C#

Sep 5 2013 2:16 AM
when I am searching  for some records in gridview, the error message is showing like
"Specified argument was out of the range of valid values"

the code is:

con.Open();
string query = "select Name from View where ID like'" + txtID.Text +"%'";
            SqlDataAdapter da = new SqlDataAdapter(query, con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            if (ds.Tables[0].Rows.Count > 0)
            {
                GridViewItm.DataSource = ds;
                GridViewItm.DataBind();
                GridViewItm.Show();
            }
            else
            {
                Response.Write(@"<script language='javascript'>alert('Requested Records Not Found')</script>");
            }

Answers (1)