Hi, I am working with Crystal Reports in Visual Studio .NET 2003 and there something that I wanted to ask about database fields.
In example, I have a table named Cost with four colums which are Cost01, Cost02, Cost03 and Cost04.
I want to access to all 4s column with a for a for structure, but I can`t find the right way to access the fields with strings.
This is what I have tried :
dim i as integer
dim TotalCost as integer = 0
for i = 1 to 4
TotalCost += {"Cost.Cost0"+"i"}
next
(Doesn`t work)
This also
dim i as integer
dim TotalCost as integer = 0
for i = 1 to 4
TotalCost += {`Cost.Cost0`+`i`}
next
(doesn`t work)
dim i as integer
dim TotalCost as integer = 0
dim test as string
for i = 1 to 4
test = "Cost.Cost0"+"i"
TotalCost += {test}
next
(doesn`t work either)
Does someone knows how to solve this problem ??
Thanks
In example, I have a table named Cost with four colums which are Cost01, Cost02, Cost03 and Cost04.
I want to access to all 4s column with a for a for structure, but I can`t find the right way to access the fields with strings.
This is what I have tried :
dim i as integer
dim TotalCost as integer = 0
for i = 1 to 4
TotalCost += {"Cost.Cost0"+"i"}
next
(Doesn`t work)
This also
dim i as integer
dim TotalCost as integer = 0
for i = 1 to 4
TotalCost += {`Cost.Cost0`+`i`}
next
(doesn`t work)
dim i as integer
dim TotalCost as integer = 0
dim test as string
for i = 1 to 4
test = "Cost.Cost0"+"i"
TotalCost += {test}
next
(doesn`t work either)
Does someone knows how to solve this problem ??
Thanks