Подскажите, пожалуйста, что с этим не так?
ALTER proc [dbo].[UrunuGetir](@basharf nvarchar(5))
as
select adi, urunid, kategori
from urun
where (UPPER(adi) like UPPER('%' +'@basharf'+ '%'))
or (LOWER(adi) like LOWER ('%' +'@basharf'+ '%'))
order by kategori
Нет ошибок, но также нет данных.
Вот редактирование:
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text != null)
{
UrunGetir(TextBox1.Text);
}
else
{
return;
}
}
private void UrunGetir(string p)
{
SqlConnection baglanti = new SqlConnection("....");
SqlDataAdapter dap = new SqlDataAdapter("select adi, urunid, kategori, birimf from urun where (UPPER(adi) like '%' + UPPER(@basharf) + '%' ) or (LOWER(adi) like '%' + LOWER(@basharf) + '%' ) order by kategori", baglanti);
dap.SelectCommand.Parameters.Add("@basharf", p);
if (baglanti.State == System.Data.ConnectionState.Closed)
baglanti.Open();
DataTable dt = new DataTable();
dap.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
if (baglanti.State == System.Data.ConnectionState.Open)
baglanti.Close();
HiddenField1.Value = p.Substring(0,p.Length);
}