Krishna

Krishna

  • NA
  • 37
  • 9.4k

i will like to retrieve the element which is not like same

Mar 23 2015 3:01 AM
 i would like to retrieve the the text which is not like the text i entered in the text box here is my code i am not getting the table displayed 


.cs

        string x = Request.QueryString["Name"] + "%";

        con.Open();
        SqlCommand scom = new SqlCommand();
        scom.Connection = con;

        scom.CommandText = "select Keyword from products where keyword NOT  LIKE @x ";
       // scom.CommandText = "select * from proper where @x notlike keyword";
        scom.Parameters.AddWithValue("@x", x);
        DataSet ds = new DataSet();
        SqlDataAdapter dap = new SqlDataAdapter();
        dap.SelectCommand = scom;
        dap.Fill(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();

Answers (6)