-
Trouble trying to display integer values
Hi I am developing an asp.net web application using c# and having trouble trying to display integer values, that I have taken from the database, correctly on my webform textboxes. The values are consistently displayed with four 0’s after the decimal point and I am just wondering if anyone knows how to prevent this from happening. Thanks in advance.
Tadhg88
-
What code are you using to read and display the values?
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
Type mistake
sorry amateur error they are actually stored in the sql server database table as "money" and the code im using to display them is
sqlDataAdapter1.Fill(archivedConcertDataSet1);
DataTable archivedConcerts = archivedConcertDataSet1.Tables["ArchivedConcert"];
foreach(DataRow myRow in archivedConcerts.Rows)
{
if(SelectConcert.SelectedItem.ToString() == myRow[0].ToString())
{
//*** fill textboxes with the concert data
ViewNumOfPerformances.Text = myRow[1].ToString();
ViewFeesDue.Text = myRow[2].ToString();
ViewPercentageOfTicketSales.Text = myRow[3].ToString();
ViewTotalTicketSales.Text = myRow[4].ToString();
ViewProfitOrLoss.Text = myRow[5].ToString();
}
}
-
Try this:
ViewFeesDue.Text = myRow[2].Value.ToString("c");
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks