
نوشته شده توسط
تبسم ساینا
select price from product where name like '%' + txtname.text + '%'
این کوئری رو باید اجرا کنید.
با فرض بر اینکه Product اسم جدولتونه
دوست عزیز این کد های منه :
SqlConnection M = new SqlConnection("Data Source=.;Initial Catalog=mobile;Integrated Security=True");
M.Open();
String s2 = string.Format("select fikharid from sabtkala where namekala like '%' + textBox2.text + '%'");
SqlCommand comm2 = new SqlCommand(s2, M);
SqlDataAdapter adap = new SqlDataAdapter(comm2);
DataTable dt = new DataTable();
adap.Fill(dt);
dataGridView1.DataSource = dt;
ولی کار نمیکنه پیغام میده ! کدی که دادین باید کجا بزارم ؟
چجوری بزارمش کار کنه ؟
ممنون میشم راهنمایی کنید
تشکر