By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,960 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,960 IT Pros & Developers. It's quick & easy.

Formatting DataBound Controls

P: 5
I am running into a problem that I cannot seem to solve.

I'm using ADO.NET 2.0 with vb 2005. I have a dataset as a datasource that selects all of the Shoe_Types from a Shoe_Type table. I am creating the data set and doing all of the data binding at runtime.

I then bind each label at run time by doing:
Expand|Select|Wrap|Line Numbers
  1. Me.lblShoeTypePrice.DataBindings.Add("text", Shoe_Type_DataTable, "Shoe_Price")
I'm not exactly sure how I should go about formatting the label so that it shows up as currency. The shoe price label will display a value like 4.0000 when I want it to be $4.00. The datatype for shoe price is currency in SQL Server 2005.

Right now I'm doing things like this:

Expand|Select|Wrap|Line Numbers
  1. Me.lblDailyCost.Text = FormatCurrency(Me.lblDailyCost.Text, 2)
I don't really like doing it that way since it could cause problems if there isn't a shoe type price.

I was wondering if formatting the datacolumn in the ShoeType DataTable to type currency would be best. Anyway...can anyone explain the common practice for this sort of thing? Thanks a ton!!
Apr 27 '07 #1
Share this Question
Share on Google+
1 Reply

P: 5
...Not sure how to just edit a post..but

So i've been searching on this topic all day and refined my google search and came across a similar post here at Changing 2 words around can do the trick I guess. I'm gonna go over this [HTML][/HTML]
later, but if anyone has any quick advice I'd love to hear it. Thanks
Apr 27 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.