469,904 Members | 2,309 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

Auto populate a field in VB ASP.NET

Hi All,


> I've created a VB.NET 2005 form, with a SQL Server 2000 backend
> The form has about 30 fields that populate 30 columns in the SQL database
> The form has mostly text feilds, with standard info such as Customer, order Number, etc.
> Im trying to autopopulate one of the feilds on the form, called Reference Number.
> The SQL column on the backend auto increments fine
> The Reference Numbercolumn has identity specification 'Yes', Increment '1', etc.

> I fill out all the fields on the .aspx form, it populates the database fine
> The Reference number auto increments by 1, which is great

> Employee should be able to launch the form, and have the Reference Number field auto populate on the form.

> Should the Reference Number part of the VB.NET web form be a label?

A text box accepts input from a user... but in the case of the Reference Number, the user should have it automatically populated open launching the page. sounds like a label to me.

Any help, code samples would be appreciated.


Jun 2 '09 #1
2 4512
3,525 Expert 2GB
A label would certainly work. Does it give you the visual appearance you want on the form? If everything else is a text box, maybe using a textbox would give you a more consistent appearance. Setting it to "read only" would keep people from changing the value. Changing the backcolor to something slightly off from the other textboxes gives the look that it is *meant* to not be changeable. You could also just set it to "enabled = false" to give it a dimmed appearance, not changeable, yet still readable.

So yes, a label will work. Do you like how that looks?
Jun 2 '09 #2
Well, tlhintoq, your absolutely correct. A text box is better, set as read only - and changing the back color to show its not supposed to be changable. Your already getting me in the right direction!!

Now... how do I get this Text box populated with the auto increment from the database. It probably starts with some code in a Page_Load event... since a page load by the visitor is the event that fires the web form.

Thanks again!
Jun 2 '09 #3

Post your reply

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

Similar topics

1 post views Thread by John | last post: by
1 post views Thread by Jim | last post: by
2 posts views Thread by keri | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.