Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 1st, 2006, 01:17 AM
Registered User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Formatting TextBox bound to a database column

I am facing two problems, pertaining to formatting the textboxes in my VB.NET project with SQL Server.

First, I have a TextBox bound to 'Smallmoney' column, which displays the number upto 4 digits after decimal. I want to make it display just to 2 places after decimal.

Second, another TextBox bound to 'Smalldatetime' column, does not let input date in "dd-mm-yy" format. I want to get it done programatically, without manual modifications in the "Regional Options".

I think, the second problem can be solved using the Culture object, but I don't know how to do it.

Is there anybody who can help a novice, please!

 
Old September 6th, 2006, 07:47 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

These can both be solved in SQL Server:

Money Field:
convert(varchar,[fieldName],0) as [fieldName] (returns 0.00 format)

Date Field:
Convert(varchar(10), [fieldName], 105) as [fieldName] (returns dd-mm-yy format)


"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
Bound Template Column in DataGrid dginley ASP.NET 1.0 and 1.1 Professional 2 November 4th, 2006 03:17 PM
Need Help - Bound DataGridView Formatting Problem mbetter .NET Framework 2.0 0 November 4th, 2005 08:46 PM
template column and bound column hidayah ASP.NET 1.x and 2.0 Application Design 1 April 9th, 2005 03:50 PM
Masked TextBox & formatting TextBox melvik C# 1 September 22nd, 2003 11:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.