Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding int values from database in C#

Status
Not open for further replies.

rodeomount

Programmer
Sep 25, 2007
50
US
I am writing an active report where I am trying to add 2 values from the database in the following way:



Code:
this.txtNumAddedTotal.Text = (this.Fields["intNewBPVRegistrations"].Value() + this.Fields["intNewBPVRegistrations"].Value());

But I'm getting an error stating:

C:\SourceSafe\Praeses\JurisdictionOnline\Reports\JOReport173_net\rptALOperationalSummary.cs(135): 'DataDynamics.ActiveReports.Field.Value' denotes a 'property' where a 'method' was expected

What am I doing wrong?
 
Try this

Code:
this.txtNumAddedTotal.Text = (Convert.ToInt32(this.Fields["intNewBPVRegistrations"].Value) + Convert.ToInt32(this.Fields["intNewBPVRegistrations"].Value));

You know you're adding the same field together, right?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top