473,661 Members | 2,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Formatting DataBound Controls

5 New Member
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
1 1318
scoarescoare
5 New Member
...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 thescripts.com. Changing 2 words around can do the trick I guess. I'm gonna go over this [HTML]http://www.thescripts. com/forum/thread379170.ht ml[/HTML]
later, but if anyone has any quick advice I'd love to hear it. Thanks
Apr 27 '07 #2

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

Similar topics

4
4145
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I want all of the controls in whatever is the CURRENT record to have it's data bolded on the screen. (Question #1: Is there a SIMPLE way to refer to the Current Record?) I've been trying to use a Bookmark to specify the current record, but it
0
1126
by: John Smith | last post by:
Hello all: Another day another problem :). How do you synch a databound combobox with the rest of the controls that are on a form. I have a combobox that lists a bunch of names and upon selection I would like the rest of the form items (mostly textboxes) to fill in with the details of the selected name. I have databound the other controls but they do not update, they remain on the first item in the DataSet. I have even tried to use...
1
1551
by: Johnny Liner | last post by:
Hello... I am creating a CurrencyManager object and setting it like this ... Code: Dim cm as CurrencyManager (...) 'On Open event of form cm = Me.BindingContext(ds,"tblPersonData")
7
6211
by: Mark | last post by:
Hello. I am developing an Access 2000 form, and I want to populate a databound list box using a saved query that requires parameters. Is there any way to do this? I tried creating a DAO querydef object and setting the parameters, and then assigned the querydef object to the list box "rowsource" property. This did not work. Thanks -Mark
5
14103
by: clickon | last post by:
This is driving me nuts, it is such a simply thing to do but i cannot for the life of me work out how you are suposed to do it. I want to update the data in DropDownListB based on what is selected in DropDownListA. I am not trying to do anything fancy with AJAX, i am happy to use Post Backs. If it were two controls just on the page then i would simply specify a control parameter for the SelectCommand of the SQLDataSource control which...
3
5415
by: Jeff | last post by:
hey asp.net 2.0 I want to programmatically populate (with data from the database) a label control in a FormView on a webpage. Is it a good idea to put my logic inside the DataBound event of the FormView?
6
6654
by: =?Utf-8?B?SnVzdGlu?= | last post by:
Hello: Does anyone know how I can create a multi-column listbox in VB.Net (Windows)...I am using VS.Net 2003. If there is another control available that can be databound with multiple columns, I would be interested in looking into that as well. Here is the code I have (it cannot display multiple columns)...
0
2198
by: morathm | last post by:
I have a windows client database management application written in C# that connects to remote web services to do all the heavy work. The thin-client app uses strong typed datasets, all maintained at the web service, with a web reference to those datasets via exposed s on the web service. The client app has a series of windows forms designed to manage particular types of data. For example, there's a manage users form. On each of these...
6
4590
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this works fine: Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8855
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8758
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7364
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.