01.
string
sql =
" Select * from customer "
;
02.
if
(radio_id.
checked
==
true
)
03.
{
04.
sql +=
"Where id_no = '+ txt_box.Text +'"
05.
}
06.
else
(radio_name.
07.
08.
"Where name = '+ txt_box.Text +'"
09.
10.
using
( var db =
new
DBEnitity())
var ds = (from c
in
db.customer
where c.id_no ==
'100005'
//ต้องการเปลี่ยนเงื่อนไขตรงนี้ครับ
select c).ToList();
(ds.Count >0)
11.
dataGridview.DataSource = ds;
12.
13.
select c);
ds = ds.Where(o => (o.id_no == txt_box.Text));
ds = ds.Where(o => (o.name == txt_box.Text));
1.
2.
where c.id_no = (radio_id.
? txt_box.text : c.id_no) and c.name = (radio_name.
() ? txt_name.text : c.name)
3.
select c).toList();
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง