Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataSet Navigation and manipulation

Status
Not open for further replies.

KurtMillikin

Programmer
Feb 21, 2003
7
US
I am trying to loop through a dataset table ds.Tables["SHARES"] get a value from columns ["FUND"], ["SHARES"] then locate the share price in ds.Tables["PriceFile"] by locating the result from [FUND"] in PricFile then multiply round((shares * price),2) = cash.

Finally update the current row in the foreach loop of ds.Tables["SHARES"] columns PRICE ans CASH.

The variable cash price and shares are all numeric and I get a "cannot implictiy convert object value to" in this case float (What would SQL datatype "money" be?)and I only see a way to cast the value .ToString().

I'm also having problems with the syntax relating to looping through the DataSet.

This is what I am trying to get:

shares = the value in column "SHARES" in the current Row
fund = the value in "FUND" then perform the task at the top.

This is a lot to ask I know. I can't seem to find an example anywhere .Thanks in advance to anyone that might help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top