A table with two columns [message #842974] |
Thu, 12 April 2012 18:17 |
|
Hi there everyone !!!
I want to do two things:
1. Get the sum of the column "Price".
2. Save all table's content in a MySQL table.
For the second issue I try this:
for(int row = 0; row < vista.tdetalle.getItemCount(); row++)
{
//product = item.getText(0);
//price = item.getText(1);
product = item.getText(row); // How can I set the first column here???
price = item.getText(row);// How can I set the second column here???
facade.RegistrarBitacora(product,price);//Here save on DB
}
That code only saves the last row.
I fill my table like this:
for(CProductoDTO catalogoproductos :coleccion)
{
item = new TableItem(vista.tdetalle, SWT.NONE);
item.setText(new String[]
{
catalogoproductos.get_Nombre_Producto(),//product
catalogoproductos.get_Precio_Producto(),//price
});
}
I need some illustration here. Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.11761 seconds