Home » Community » Newbie corner » gridctrl with sql
gridctrl with sql [message #34010] |
Sun, 09 October 2011 07:03 |
|
Hi-
In the code below it adds the fields to the grid funny.
The values are off by one in the order they are added to the grid.
For i.e. sql[0] value is 1 but sql[1] abcd value is added in the
first column to the grid. So instead of:
1 | abcd : I get abcd in column 1.
I am using postgresql. Any ideas how I can get the sql result set
to appear in the correct columns in the grid?
thanks - jim
void ListMiser::LoadProducts()
{
SqlId all("*");
Sql sql(m_session);
sql.ClearError();
products.Clear();
sql * Select(all).From(PRODUCTS).Where(product_id ==1);
while(sql.Fetch()){
products.Add(sql);
Cout() << sql[0] << " " << sql[5] << " \'" << "\'\n";
}
}
|
|
|
Goto Forum:
Current Time: Tue May 28 16:03:22 CEST 2024
Total time taken to generate the page: 0.00568 seconds
|