Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » gridctrl with sql
gridctrl with sql [message #34010] Sun, 09 October 2011 07:03 Go to previous message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

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";
}
}


 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Creating a form inside a DLL
Next Topic: Linking error with gdk_pixbuf-2.0
Goto Forum:
  


Current Time: Tue May 28 16:03:22 CEST 2024

Total time taken to generate the page: 0.00568 seconds