Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Perform operations on c++ DataTable

Perform operations on c++ DataTable

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
24 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11196121
    wrote on last edited by
    #1

    Hi all might I ask some advice/fixes on the below code, as I am still not familiar with referencing multiple columns from DataTable in c++ yet? :confused: Your inputs would be much appreciated. Thanks in advance.

    MySqlCommand^CmdDataBase = gcnew MySqlCommand("select * from world.city",conDataBase);
    try{
    conDataBase->Open();
    MySqlDataAdapter^sda= gcnew MySqlDataAdapter();
    sda->SelectCommand=CmdDataBase;
    DataTable^dbdataset=gcnew DataTable();
    DataColumn^rt_col=gcnew DataColumn();
    rt_col->ColumnName = "Ret";
    rt_col->DataType=System::Type::GetType("System.Double");
    dbdataset->Columns->Add(rt_col);

    				 DataRow^rt\_row;
    				 
    				 for (int row=0;dbdataset->Rows->Count;row++)				 
    				 {
    					 rt\_row=dbdataset->NewRow();
    					 rt\_row\["Ret"\]=System::Convert::ToDouble(rt\_row\["Population"\])/System::Convert::ToDouble(rt\_row\["Population"\]);
    				     //rt\_row\["DataReturn"\]=System::Convert::ToDouble(dbdataset->Rows\[row\]\["Population"\])/System::Convert::ToDouble(dbdataset->Rows\[row-1\]\["Population"\]);
    					 dbdataset->Rows->Add(rt\_row);
    					 
    				 }
    				 
    				 sda->Fill(dbdataset);	
    				 BindingSource^bSource=gcnew BindingSource();
    				 bSource->DataSource=dbdataset;
    				 dtGrid->DataSource=bSource;
    			 
    			 } 
    			 catch(Exception^ex) {
    				 MessageBox::Show(ex->Message);
    	 }
    
    P B N L 4 Replies Last reply
    0
    • U User 11196121

      Hi all might I ask some advice/fixes on the below code, as I am still not familiar with referencing multiple columns from DataTable in c++ yet? :confused: Your inputs would be much appreciated. Thanks in advance.

      MySqlCommand^CmdDataBase = gcnew MySqlCommand("select * from world.city",conDataBase);
      try{
      conDataBase->Open();
      MySqlDataAdapter^sda= gcnew MySqlDataAdapter();
      sda->SelectCommand=CmdDataBase;
      DataTable^dbdataset=gcnew DataTable();
      DataColumn^rt_col=gcnew DataColumn();
      rt_col->ColumnName = "Ret";
      rt_col->DataType=System::Type::GetType("System.Double");
      dbdataset->Columns->Add(rt_col);

      				 DataRow^rt\_row;
      				 
      				 for (int row=0;dbdataset->Rows->Count;row++)				 
      				 {
      					 rt\_row=dbdataset->NewRow();
      					 rt\_row\["Ret"\]=System::Convert::ToDouble(rt\_row\["Population"\])/System::Convert::ToDouble(rt\_row\["Population"\]);
      				     //rt\_row\["DataReturn"\]=System::Convert::ToDouble(dbdataset->Rows\[row\]\["Population"\])/System::Convert::ToDouble(dbdataset->Rows\[row-1\]\["Population"\]);
      					 dbdataset->Rows->Add(rt\_row);
      					 
      				 }
      				 
      				 sda->Fill(dbdataset);	
      				 BindingSource^bSource=gcnew BindingSource();
      				 bSource->DataSource=dbdataset;
      				 dtGrid->DataSource=bSource;
      			 
      			 } 
      			 catch(Exception^ex) {
      				 MessageBox::Show(ex->Message);
      	 }
      
      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Try Q/A or the C++ forum

      U 1 Reply Last reply
      0
      • U User 11196121

        Hi all might I ask some advice/fixes on the below code, as I am still not familiar with referencing multiple columns from DataTable in c++ yet? :confused: Your inputs would be much appreciated. Thanks in advance.

        MySqlCommand^CmdDataBase = gcnew MySqlCommand("select * from world.city",conDataBase);
        try{
        conDataBase->Open();
        MySqlDataAdapter^sda= gcnew MySqlDataAdapter();
        sda->SelectCommand=CmdDataBase;
        DataTable^dbdataset=gcnew DataTable();
        DataColumn^rt_col=gcnew DataColumn();
        rt_col->ColumnName = "Ret";
        rt_col->DataType=System::Type::GetType("System.Double");
        dbdataset->Columns->Add(rt_col);

        				 DataRow^rt\_row;
        				 
        				 for (int row=0;dbdataset->Rows->Count;row++)				 
        				 {
        					 rt\_row=dbdataset->NewRow();
        					 rt\_row\["Ret"\]=System::Convert::ToDouble(rt\_row\["Population"\])/System::Convert::ToDouble(rt\_row\["Population"\]);
        				     //rt\_row\["DataReturn"\]=System::Convert::ToDouble(dbdataset->Rows\[row\]\["Population"\])/System::Convert::ToDouble(dbdataset->Rows\[row-1\]\["Population"\]);
        					 dbdataset->Rows->Add(rt\_row);
        					 
        				 }
        				 
        				 sda->Fill(dbdataset);	
        				 BindingSource^bSource=gcnew BindingSource();
        				 bSource->DataSource=dbdataset;
        				 dtGrid->DataSource=bSource;
        			 
        			 } 
        			 catch(Exception^ex) {
        				 MessageBox::Show(ex->Message);
        	 }
        
        B Offline
        B Offline
        bryce
        wrote on last edited by
        #3

        yeah so the man you want to ask is Christan Grauss, hes the man on exactly this sort of thing. A lovely chap who is so helpful and nice too boot, he'd be more than happy to help you out cheers Bryce

        MCAD ---

        U N 2 Replies Last reply
        0
        • P PIEBALDconsult

          Try Q/A or the C++ forum

          U Offline
          U Offline
          User 11196121
          wrote on last edited by
          #4

          Sure. Also posted i to "general programming" -> c/c++/mfc after realizing it. cheers

          1 Reply Last reply
          0
          • B bryce

            yeah so the man you want to ask is Christan Grauss, hes the man on exactly this sort of thing. A lovely chap who is so helpful and nice too boot, he'd be more than happy to help you out cheers Bryce

            MCAD ---

            U Offline
            U Offline
            User 11196121
            wrote on last edited by
            #5

            Thanks Bryce for your prompt feedback. Look forward to getting Christian Grauss' assistance on this issue, after spending a few days to sort it out by myself. Cheers

            1 Reply Last reply
            0
            • B bryce

              yeah so the man you want to ask is Christan Grauss, hes the man on exactly this sort of thing. A lovely chap who is so helpful and nice too boot, he'd be more than happy to help you out cheers Bryce

              MCAD ---

              N Offline
              N Offline
              Nelek
              wrote on last edited by
              #6

              You missed :Evilgrinse: :Evilgrinse: :Evilgrinse: in your post ;P

              M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

              B 1 Reply Last reply
              0
              • U User 11196121

                Hi all might I ask some advice/fixes on the below code, as I am still not familiar with referencing multiple columns from DataTable in c++ yet? :confused: Your inputs would be much appreciated. Thanks in advance.

                MySqlCommand^CmdDataBase = gcnew MySqlCommand("select * from world.city",conDataBase);
                try{
                conDataBase->Open();
                MySqlDataAdapter^sda= gcnew MySqlDataAdapter();
                sda->SelectCommand=CmdDataBase;
                DataTable^dbdataset=gcnew DataTable();
                DataColumn^rt_col=gcnew DataColumn();
                rt_col->ColumnName = "Ret";
                rt_col->DataType=System::Type::GetType("System.Double");
                dbdataset->Columns->Add(rt_col);

                				 DataRow^rt\_row;
                				 
                				 for (int row=0;dbdataset->Rows->Count;row++)				 
                				 {
                					 rt\_row=dbdataset->NewRow();
                					 rt\_row\["Ret"\]=System::Convert::ToDouble(rt\_row\["Population"\])/System::Convert::ToDouble(rt\_row\["Population"\]);
                				     //rt\_row\["DataReturn"\]=System::Convert::ToDouble(dbdataset->Rows\[row\]\["Population"\])/System::Convert::ToDouble(dbdataset->Rows\[row-1\]\["Population"\]);
                					 dbdataset->Rows->Add(rt\_row);
                					 
                				 }
                				 
                				 sda->Fill(dbdataset);	
                				 BindingSource^bSource=gcnew BindingSource();
                				 bSource->DataSource=dbdataset;
                				 dtGrid->DataSource=bSource;
                			 
                			 } 
                			 catch(Exception^ex) {
                				 MessageBox::Show(ex->Message);
                	 }
                
                N Offline
                N Offline
                Nareesh1
                wrote on last edited by
                #7

                change

                for (int row=0;dbdataset->Rows->Count;row++)

                to

                for (int row=0;row < dbdataset->Rows->Count;row++)

                Due to in mathematics the commutative property, since row = 0, 0 = row, therefore can be written more interpretative as to reduce the cycle CPU

                for (int row=0;0 < dbdataset->Rows->Count;row++)

                U 1 Reply Last reply
                0
                • N Nelek

                  You missed :Evilgrinse: :Evilgrinse: :Evilgrinse: in your post ;P

                  M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                  B Offline
                  B Offline
                  bryce
                  wrote on last edited by
                  #8

                  and give the game away?

                  MCAD ---

                  N 1 Reply Last reply
                  0
                  • U User 11196121

                    Hi all might I ask some advice/fixes on the below code, as I am still not familiar with referencing multiple columns from DataTable in c++ yet? :confused: Your inputs would be much appreciated. Thanks in advance.

                    MySqlCommand^CmdDataBase = gcnew MySqlCommand("select * from world.city",conDataBase);
                    try{
                    conDataBase->Open();
                    MySqlDataAdapter^sda= gcnew MySqlDataAdapter();
                    sda->SelectCommand=CmdDataBase;
                    DataTable^dbdataset=gcnew DataTable();
                    DataColumn^rt_col=gcnew DataColumn();
                    rt_col->ColumnName = "Ret";
                    rt_col->DataType=System::Type::GetType("System.Double");
                    dbdataset->Columns->Add(rt_col);

                    				 DataRow^rt\_row;
                    				 
                    				 for (int row=0;dbdataset->Rows->Count;row++)				 
                    				 {
                    					 rt\_row=dbdataset->NewRow();
                    					 rt\_row\["Ret"\]=System::Convert::ToDouble(rt\_row\["Population"\])/System::Convert::ToDouble(rt\_row\["Population"\]);
                    				     //rt\_row\["DataReturn"\]=System::Convert::ToDouble(dbdataset->Rows\[row\]\["Population"\])/System::Convert::ToDouble(dbdataset->Rows\[row-1\]\["Population"\]);
                    					 dbdataset->Rows->Add(rt\_row);
                    					 
                    				 }
                    				 
                    				 sda->Fill(dbdataset);	
                    				 BindingSource^bSource=gcnew BindingSource();
                    				 bSource->DataSource=dbdataset;
                    				 dtGrid->DataSource=bSource;
                    			 
                    			 } 
                    			 catch(Exception^ex) {
                    				 MessageBox::Show(ex->Message);
                    	 }
                    
                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Perhaps if you explained what the problem is then we would be able to offer some suggestions. Apart from the obvious error in the line:

                    for (int row=0;dbdataset->Rows->Count;row++)

                    which, presumably, is meant to be:

                    for (int row=0; row < dbdataset->Rows->Count; row++)

                    U 1 Reply Last reply
                    0
                    • N Nareesh1

                      change

                      for (int row=0;dbdataset->Rows->Count;row++)

                      to

                      for (int row=0;row < dbdataset->Rows->Count;row++)

                      Due to in mathematics the commutative property, since row = 0, 0 = row, therefore can be written more interpretative as to reduce the cycle CPU

                      for (int row=0;0 < dbdataset->Rows->Count;row++)

                      U Offline
                      U Offline
                      User 11196121
                      wrote on last edited by
                      #10

                      Thanks Nareesh for the advice, although it does not help in solving the main issue: "Performing operations on DataTable" by referencing multiple columns Best, Member 11230372

                      1 Reply Last reply
                      0
                      • B bryce

                        and give the game away?

                        MCAD ---

                        N Offline
                        N Offline
                        Nelek
                        wrote on last edited by
                        #11

                        That would be only if the OP gets it ;P :evilgrinse: :laugh: :laugh:

                        M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                        U 1 Reply Last reply
                        0
                        • L Lost User

                          Perhaps if you explained what the problem is then we would be able to offer some suggestions. Apart from the obvious error in the line:

                          for (int row=0;dbdataset->Rows->Count;row++)

                          which, presumably, is meant to be:

                          for (int row=0; row < dbdataset->Rows->Count; row++)

                          U Offline
                          U Offline
                          User 11196121
                          wrote on last edited by
                          #12

                          Hi Richard First of all thanks for the assistance. Basically what I am trying to achieve can be described as follows: 1-creating a database connexion, run a query and store the result in my Datatable's object dbdataset(see code below). city table has 5 columns 2-adding an extra column "ret" to dbdataset

                          MySqlCommand^CmdDataBase = gcnew MySqlCommand("select * from world.city",conDataBase);
                          try{
                          conDataBase->Open();
                          MySqlDataAdapter^sda= gcnew MySqlDataAdapter();
                          sda->SelectCommand=CmdDataBase;
                          DataTable^dbdataset=gcnew DataTable();
                          DataColumn^rt_col=gcnew DataColumn();
                          rt_col->ColumnName = "Ret";
                          rt_col->DataType=System::Type::GetType("System.Double");
                          dbdataset->Columns->Add(rt_col);

                          3-fill "ret" rows based on values from column "Population"

                          DataRow^rt_row;

                                           for (int row=0;row<dbdataset->Rows->Count;row++)
                                           {
                                               rt\_row=dbdataset->NewRow();
                                               rt\_row\["Ret"\]=log(System::Convert::ToDouble(rt\_row\["Population"\]\[row\])/System::Convert::ToDouble(rt\_row\["Population"\]\[row-1\]));
                                               //rt\_row\["DataReturn"\]=System::Convert::ToDouble(dbdataset->Rows\[row\]\["Population"\])/System::Convert::ToDouble(dbdataset->Rows\[row-1\]\["Population"\]);
                                               dbdataset->Rows->Add(rt\_row);
                          

                          1- and 2- are fine but I am completely stuck on 3. Hope you understand better my goal through this explanation. cheers member 11230372

                          L 1 Reply Last reply
                          0
                          • N Nelek

                            That would be only if the OP gets it ;P :evilgrinse: :laugh: :laugh:

                            M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                            U Offline
                            U Offline
                            User 11196121
                            wrote on last edited by
                            #13

                            :doh:

                            N 1 Reply Last reply
                            0
                            • U User 11196121

                              Hi Richard First of all thanks for the assistance. Basically what I am trying to achieve can be described as follows: 1-creating a database connexion, run a query and store the result in my Datatable's object dbdataset(see code below). city table has 5 columns 2-adding an extra column "ret" to dbdataset

                              MySqlCommand^CmdDataBase = gcnew MySqlCommand("select * from world.city",conDataBase);
                              try{
                              conDataBase->Open();
                              MySqlDataAdapter^sda= gcnew MySqlDataAdapter();
                              sda->SelectCommand=CmdDataBase;
                              DataTable^dbdataset=gcnew DataTable();
                              DataColumn^rt_col=gcnew DataColumn();
                              rt_col->ColumnName = "Ret";
                              rt_col->DataType=System::Type::GetType("System.Double");
                              dbdataset->Columns->Add(rt_col);

                              3-fill "ret" rows based on values from column "Population"

                              DataRow^rt_row;

                                               for (int row=0;row<dbdataset->Rows->Count;row++)
                                               {
                                                   rt\_row=dbdataset->NewRow();
                                                   rt\_row\["Ret"\]=log(System::Convert::ToDouble(rt\_row\["Population"\]\[row\])/System::Convert::ToDouble(rt\_row\["Population"\]\[row-1\]));
                                                   //rt\_row\["DataReturn"\]=System::Convert::ToDouble(dbdataset->Rows\[row\]\["Population"\])/System::Convert::ToDouble(dbdataset->Rows\[row-1\]\["Population"\]);
                                                   dbdataset->Rows->Add(rt\_row);
                              

                              1- and 2- are fine but I am completely stuck on 3. Hope you understand better my goal through this explanation. cheers member 11230372

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #14

                              Member 11230372 wrote:

                              2-adding an extra column "ret" to dbdataset

                              Member 11230372 wrote:

                              3-fill "ret" rows based on values from column "Population"

                              Now I am confused, do you mean rows or columns? Assuming you mean columns, which is what you have added, your code should be something like:

                              for (int row=0; row < dbdataset->Rows->Count; row++)
                              {
                              rt_row=dbdataset->Rows[row];
                              rt_row["Ret"] = log(System::Convert::ToDouble(rt_row["Population"]) / --> not sure what this calculation should be
                              // System::Convert::ToDouble(rt_row["Population"][row-1]));
                              //rt_row["DataReturn"]=System::Convert::ToDouble(dbdataset->Rows[row]["Population"])/System::Convert::ToDouble(dbdataset->Rows[row-1]["Population"]);
                              // dbdataset->Rows->Add(rt_row);
                              }

                              U 1 Reply Last reply
                              0
                              • L Lost User

                                Member 11230372 wrote:

                                2-adding an extra column "ret" to dbdataset

                                Member 11230372 wrote:

                                3-fill "ret" rows based on values from column "Population"

                                Now I am confused, do you mean rows or columns? Assuming you mean columns, which is what you have added, your code should be something like:

                                for (int row=0; row < dbdataset->Rows->Count; row++)
                                {
                                rt_row=dbdataset->Rows[row];
                                rt_row["Ret"] = log(System::Convert::ToDouble(rt_row["Population"]) / --> not sure what this calculation should be
                                // System::Convert::ToDouble(rt_row["Population"][row-1]));
                                //rt_row["DataReturn"]=System::Convert::ToDouble(dbdataset->Rows[row]["Population"])/System::Convert::ToDouble(dbdataset->Rows[row-1]["Population"]);
                                // dbdataset->Rows->Add(rt_row);
                                }

                                U Offline
                                U Offline
                                User 11196121
                                wrote on last edited by
                                #15

                                Thanks for your proactivity Richard, which is really appreciated. after adding an extra column "Ret" my table is looking like: Ret |Population|ID|... Hence my purpose is to fill Ret rows with values from "Population" column for instance: Row["Ret"][0] = log (row["Population"][0] / row["Population"][1] ... hope it helps Cheers Member 11230372

                                L 1 Reply Last reply
                                0
                                • U User 11196121

                                  Thanks for your proactivity Richard, which is really appreciated. after adding an extra column "Ret" my table is looking like: Ret |Population|ID|... Hence my purpose is to fill Ret rows with values from "Population" column for instance: Row["Ret"][0] = log (row["Population"][0] / row["Population"][1] ... hope it helps Cheers Member 11230372

                                  L Offline
                                  L Offline
                                  Lost User
                                  wrote on last edited by
                                  #16

                                  No, it still makes no sense. You add an extra column to your table and then you say you need to store information in extra rows. Choose one or the other.

                                  U 1 Reply Last reply
                                  0
                                  • L Lost User

                                    No, it still makes no sense. You add an extra column to your table and then you say you need to store information in extra rows. Choose one or the other.

                                    U Offline
                                    U Offline
                                    User 11196121
                                    wrote on last edited by
                                    #17

                                    "No, it still makes no sense. You add an extra column to your table and then you say you need to store information in extra rows. Choose one or the other." I've added an extra ret column

                                    DataColumn^rt_col=gcnew DataColumn();
                                    rt_col->ColumnName = "Ret";
                                    rt_col->DataType=System::Type::GetType("System.Double");
                                    dbdataset->Columns->Add(rt_col);

                                    Then I need to fill the rows of this new column "Ret" based on the values held in "Population" column. 1st value of "Ret" should equal = log( 1st value of Population / 2nd value of Population) 2nd value of "Ret" = log (3rd value of Population / 4th value of Population) .... ps: please let me reiterate that both "Ret" and "Population" are columns from the datable object dbdataset. Cheers ** in vba it will take me <3 minutes to perform it but I am stuck in c++ (part of the learning process I suppose ) Again thanks for the help

                                    L 1 Reply Last reply
                                    0
                                    • U User 11196121

                                      "No, it still makes no sense. You add an extra column to your table and then you say you need to store information in extra rows. Choose one or the other." I've added an extra ret column

                                      DataColumn^rt_col=gcnew DataColumn();
                                      rt_col->ColumnName = "Ret";
                                      rt_col->DataType=System::Type::GetType("System.Double");
                                      dbdataset->Columns->Add(rt_col);

                                      Then I need to fill the rows of this new column "Ret" based on the values held in "Population" column. 1st value of "Ret" should equal = log( 1st value of Population / 2nd value of Population) 2nd value of "Ret" = log (3rd value of Population / 4th value of Population) .... ps: please let me reiterate that both "Ret" and "Population" are columns from the datable object dbdataset. Cheers ** in vba it will take me <3 minutes to perform it but I am stuck in c++ (part of the learning process I suppose ) Again thanks for the help

                                      L Offline
                                      L Offline
                                      Lost User
                                      wrote on last edited by
                                      #18

                                      I showed you how to fill it in my previous answer, but I do not know what it is that you want to fill it with.

                                      U 1 Reply Last reply
                                      0
                                      • U User 11196121

                                        :doh:

                                        N Offline
                                        N Offline
                                        Nelek
                                        wrote on last edited by
                                        #19

                                        Don't take it personal, just Offtopic jokes Without this "irony discharge" we would drive nuts ;P

                                        M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                                        1 Reply Last reply
                                        0
                                        • L Lost User

                                          I showed you how to fill it in my previous answer, but I do not know what it is that you want to fill it with.

                                          U Offline
                                          U Offline
                                          User 11196121
                                          wrote on last edited by
                                          #20

                                          Please Richard a quick look at my previous post (also copied below)

                                          "No, it still makes no sense. You add an extra column to your table and then you say you need to store information in extra rows. Choose one or the other."

                                          I've added an extra ret column
                                          DataColumn^rt_col=gcnew DataColumn();
                                          rt_col->ColumnName = "Ret";
                                          rt_col->DataType=System::Type::GetType("System.Double");
                                          dbdataset->Columns->Add(rt_col);
                                          Then I need to fill the rows of this new column "Ret" based on the values held in "Population" column.
                                          1st value of "Ret" should equal = log( 1st value of Population / 2nd value of Population)
                                          2nd value of "Ret" = log (3rd value of Population / 4th value of Population)
                                          ....

                                          ps: please let me reiterate that both "Ret" and "Population" are columns from the datable object dbdataset.

                                          Cheers

                                          ** in vba it will take me <3 minutes to perform it but I am stuck in c++ (part of the learning process I suppose ) Again thanks for the help

                                          L 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups