I have a data set say ‘ds’ which I populate from a table called tran_dtls ,
now I want to write a method to this data set(or the table in the data set ‘dt’),which would effectively retrieve for me a scalar value having the same output as this query:
select sum(amt) from TRAN_DTLS
where GL_CODE='" + row["gl_code"].ToString() + "'
and SUB_CODE='" + row["sub_code"].ToString() + "'
and DBCR='C'"
Here amt,GL_code,SUb_code,DBCR are the columns in tran_dtls table, So what I want to do is select the sum of amount having various conditions ,I have never done anything like this before so I don’t know even this would be possible or not
I don’t think you can write SQL against a DataSet. But you can use LINQ: