473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Textbox retrieving multiple values

16
Hello,

I need help in VB.NET.
I'm developing an asset management application.
assets have different types (Computer), and a label initial for this type (PC).

When the user wants to add an asset, he/she should select the type name (Computer) from a dropdownlist and the textbox that is under that dropdownlist will show the label initial (PC).

What I want the program to do is display automatically PC + the number of assets added for that specific type. (PC0001) if it was the 1st computer added and (PC0002) for the 2nd ..etc.

Note that the asset label initial and the asset number = label number which is the primary key of the asset table.

I managed to retreive the label initial into the textbox. But how can I add the number of that asset for each asset type? Should there be a property in the database to hold this value?

Solving this would make things very much easier. I would really appreciate if some one would help :)
Mar 15 '07 #1
1 1677
vijaydiwakar
579 512MB
Hello,

I need help in VB.NET.
I'm developing an asset management application.
assets have different types (Computer), and a label initial for this type (PC).

When the user wants to add an asset, he/she should select the type name (Computer) from a dropdownlist and the textbox that is under that dropdownlist will show the label initial (PC).

What I want the program to do is display automatically PC + the number of assets added for that specific type. (PC0001) if it was the 1st computer added and (PC0002) for the 2nd ..etc.

Note that the asset label initial and the asset number = label number which is the primary key of the asset table.

I managed to retreive the label initial into the textbox. But how can I add the number of that asset for each asset type? Should there be a property in the database to hold this value?

Solving this would make things very much easier. I would really appreciate if some one would help :)
try this code

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _
  3. System.EventArgs) Handles MyBase.Load
  4.  
  5.    ComboBox1.Items.Add("Nancy Davolio")
  6.    Microsoft.VisualBasic.Compatibility.VB6. _
  7.       SetItemData(ComboBox1, ComboBox1.Items.Count() - 1, 12345)
  8.  
  9.    ComboBox1.Items.Add("Judy Phelps")
  10.    Microsoft.VisualBasic.Compatibility.VB6. _
  11.       SetItemData(ComboBox1, ComboBox1.Items.Count() - 1, 67890)
  12. End Sub
  13.  
  14.  
  15. Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, _
  16. ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
  17.  
  18.    Label1.Text = "Employee #" & CStr( _
  19.    Microsoft.VisualBasic.Compatibility.VB6. _
  20.       GetItemData(ComboBox1, ComboBox1.SelectedIndex))
  21. End Sub
  22.  
try it
:)
Mar 15 '07 #2

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

Similar topics

5
by: JollyK | last post by:
Hello all, I have always been having this issue and wondering what the solution is. When I set the enableviewstate property to false for a textbox, the textbox always retains its value after a...
3
by: Justin Morris via DotNetMonster.com | last post by:
<asp:TextBox ID="TextBox1" runat="server" value='<%=Server.HtmlEncode (Request.Cookies("Username")("Username"))%>'/> <input name="Password" type="text" id="Password" value='<%...
0
by: Zark3 | last post by:
Hi all, In a web form I use a for loop to dynamically add TextBox'es to a page (one for each item in an input file). I can get the input values and I can display them in Label's and TextBox'es....
10
by: Girish | last post by:
Hi Everyone, I am passing a form to a php script for further processing. I am able to retrieve the last value set for that given form variable using $variable=$_REQUEST;
1
by: cyningeston | last post by:
OS: WinXP Pro, VB/ASP/ADO.NET I'm building a web-based supplier management application. For each supplier we are required by the FDA to track certain documents. I've managed to pull them from...
1
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i...
1
by: scripter666 | last post by:
Hi all, I need to populate mutilpe values into the multiple list text box and select the required values from the textbox and pass it for further functions. <select name="options" size=4...
1
by: silpa | last post by:
I have a form named dataentry1.aspx It has Name,Age,centimetres,metres textboxes. we will enter name in name textbox,age in age textbox. when we enter height in centimetres textbox, and after...
8
by: smoky_flame via DotNetMonster.com | last post by:
hi, is it possible to take multiple values(int) seperated by commas as input from textbox in C# and draw a figure using those values. e.g. drawing a simple path using 1,2,3,4 values. --...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.