Cara mengambil seluruh data pada ListBox,, how to retrieve all the data in the listbox,, (C#)


seperti biasa berawal dari pertanyaan seorang teman akhirnya membuat saya semakin bergairah mengisi blog ini dengan tulisan yang saya harap bermanfaat bagi banya orang,.
I hope this post can help any people,.

OK go to problem,..

Misal kita ingin mengambil semua data, kita bisa menggunakan sintaq berikut;

Suppose we want to retrieve all the data, we can use the following sintaq;

if in temporary ;
Class SalesOrder
{
private ArrayList orderDetail;

public void Add(OrderDetail order)
{
this.orderDetail.Add(order);
}

public Decimal Total()
{
Decimal total;
foreach (OrderDetail order in orderDetail)
{
total += order.Total;
}
return total;
}
}

if saved in table ;

(from o in orders
select new {
o.CustomerName,
Total = o.Lines.Sum(x=>x.UnitPrice*x.Quantity)}
).OrderBy(x=>x.CustomerName).ThenBy(x=>x.Total);;

OR BY QUERY :
SELECT SUM(total_transaksi) AS total_nominal_transaksi
FROM user

Demikian, mudah2an tidak tambah pusing, saya juga masih belajar… :)

hopefully not more confused, because I was still learning…🙂

see also,.

 https://virusbarubiru.wordpress.com/2012/12/29/menampilkan-data-dari-form1-ke-form-duan-pada-c/

https://virusbarubiru.wordpress.com/2012/12/27/657/

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s