How To Proceed Further
Jan 23, 2008Hi,
I have a table in sql server as follows charges
flag monthlycharges
1 10
2 30
3 40
and so on
I will be selecting all the details of the stock from another table called as stock
idno R1 R2 R3
1 0 1 1
2 1 0 0
3 0 0 1
Here idno is the primary key, this product has 3 features R1, R2 and R3.
If the features has the value as 1 then it means the feature is activated and I will charge the client for that
The charges are specified in the table as 1,2 and 3 for the features R1,R2 and R3 respectively.
Now I take up all the records from the second table i.e. stock and populate into a datatable
I can also find out how many features are supported by the idno.
Now how to I charge this idno, because I cannot populate the charges table
it will run somewhat like this
for (int i=0;i<dt.rows.count;i++)
{
double r1=convert.todouble(dt.rows[i][0].tostring));
}
In such a case only the last value will be taken up
Can anyone please throw some light on this.
Regards
cmrhema