Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Button2_Click(object sender, EventArgs e)
- {
- string srchDescription = searchDescription.Text;
- string slctItem = DropDownList1.SelectedItem.ToString();
- con.Open();
- SqlCommand cmdForDescription = new SqlCommand("SELECT Описание FROM car_table WHERE Вносител = '" + slctItem + "'", con);
- string descriptionText = cmdForDescription.ExecuteScalar().ToString();
- bool containsDescription = descriptionText.Contains(srchDescription);
- if (containsDescription)
- {
- SqlCommand cmd = new SqlCommand("SELECT * FROM car_table WHERE Вносител = '" + slctItem + "'", con);
- SqlDataAdapter da = new SqlDataAdapter(cmd);
- DataSet ds = new DataSet();
- da.Fill(ds);
- GridView2.DataSource = ds;
- GridView2.DataBind();
- con.Close();
- Label2.Visible = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement