i have managed to connect to an interbase database and get data from the database and store it in a dataset, i need to manipulate some of the data in the dataset and do something like the following,
add a new column in the dataset called total,
for each row i need to add the 2nd and 3rd column and place the result into the total column.
can some one shed some light on how i may do this, im using the following code to get the data into a data set.
OdbcConnection conn = new OdbcConnection();
conn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString2"].ConnectionString;
DataSet ds = new DataSet();
OdbcDataAdapter da = new OdbcDataAdapter("SELECT * FROM MTD_FIGURE_VIEW1", conn);
da.Fill(ds);
IF you are sure that your column values would never be null or empty then the best way is
In case if your any column’s value will be null then it wont give any exception but the total value would also be empty …
If there can be any null value then try this
In this case if you never check for null or empty value then this will give you a run time exception…