I'am posting on this forum for the first time . and I really hope I can find some help . What I'am doing is load about ... 1000 Value (example) from SQL and I'am doing it just fine .
the query for example is : Select Value from DatabaseA.dbo.Values
that "Value" ==> decimal(10, 2)
sqlConnection2.Open();
insertCommand2.ExecuteNonQuery();
SqlDataReader reader2 = insertCommand2.ExecuteReader();
if (reader2.HasRows)
{
while (reader2.Read())
{
decimal Value = reader.GetDecimal(0);
this propably should work fine . but What I want to do is to make + on all of them ... For example first value = 16 , second = 28 , third : 78
I want to make 16 + 28 + 78 ... but for all Values that Loaded them . How Can I do that please ? , thanks .
SELECTquery but you're usingExecuteNonQuery, then you're usingExecuteReaderon the same command to get aSqlDataReader reader2but you're usingreaderlater which you haven't shown at all.10/12/10would you like just32or10/22/32?