c# - List with two values to two different string variables -


i need

i have listview

listviewitem item = new listviewitem(myreader["date"].tostring());                     item.subitems.add(myreader["annualprice"].tostring())   date        price 112/9/1990   15.30 12/9/1990   15.30  12/9/1990   15.30 12/9/1990   15.30 

and want put 2 values in separate string variables in order use them in method accepts 2 string variables.

could me pls?

update

now here still receive same error.

could please tell me doing wrong?

 try         {             condatabase.open();             mysqldatareader myreader = cmddatabase.executereader();             while (myreader.read())             {                  var date = string.format("{0,20}", myreader["date"].tostring());                 var annualprice = string.format("{0,20}", myreader["annualprice"].tostring());                  listviewitem item = new listviewitem(date + "," + annualprice);                  //var date = string.format("{0,20}", myreader["date"].tostring());                 //var annualprice = string.format("{0,20}", myreader["annualprice "].tostring());                  rplot(date, annualprice);                  }//end while            }         catch (exception ex)         {              messagebox.show(ex.message);          }           }     //method plot data     public void rplot(string var1, string var2)     {         rengine.setenvironmentvariables();         rengine engine = rengine.getinstance();         // rengine requires explicit initialization.         // can set parameters.         engine.initialize();         string rcommand = "plot(" + var1 + "," + var2 + ")";         engine.evaluate(rcommand.tostring());     } 

loop through items , value , subitem[0] value , pass them.


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -