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

Home Posts Topics Members FAQ

how to do auto generation of numbers in C#.Net

21 New Member
Hi,

I am manivel.. Am doing C#.Net project.. I want to display the auto generation of numbers in a text box starts from 1.. But i dont know how to implement this.. If any one knows plz inform me..

Thanks in advance..

With regards,
Manivel. K
Jan 21 '08 #1
3 5931
IanWright
179 New Member
Your question isn't very clear but...

to auto-generate the numbers you will probably want to use a for loop. Then as you itterate through this loop add the results to your text box...

Expand|Select|Wrap|Line Numbers
  1. Create Textbox
  2. Add Textbox to form
  3.  
  4. for (start, end, increment)
  5.   add value to textbox
  6.  
Hi,

I am manivel.. Am doing C#.Net project.. I want to display the auto generation of numbers in a text box starts from 1.. But i dont know how to implement this.. If any one knows plz inform me..

Thanks in advance..

With regards,
Manivel. K
Jan 21 '08 #2
manivelk
21 New Member
hi,

Thanks for your reply..

I tried that but the last value of the loop only displayed in text box.. I need to display the first value and increment that.. how this is possible..
Thanks in advance..
Jan 22 '08 #3
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
what you are probably doing is

Expand|Select|Wrap|Line Numbers
  1. for(int i = 0;  i < maxNumber; i++)
  2. {
  3.    this.textBox1.Text = i.toString();
  4. }
what you would need to do is create a delegate and link it to a method incrementing the value on a certain interval.

option 2:
Use a time Control, and in the time_tick event increment the value of the text box.
Jan 22 '08 #4

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

Similar topics

4
13107
by: mescaline | last post by:
hi, i'm new to C++ could anyone refer me to a good site / good examples of random numbers? in particular including: 1) the commnds to obtain normally and exponenetially distributed r numbers
0
1281
by: Greg | last post by:
Hello, I'm about to write a database application and I'm wondering how to approach it. Is it worth to use the database code auto-generation (VC# 2005) in the long run? Or at some point I'll be thinking about rewriting the app... Is the db code auto-generation versatile enough to be useful in non-trival applications. Thanks Greg
13
4728
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when i type in the details. I have just moved over to mysql server with access as the front end. I have setup the sql tables with the customer number as autonumber. When i go into the form and add a new customer it does not generate the
22
3430
by: gagan.singh.arora | last post by:
Hi there. I want to generate random numbers with a given probability, say 80% even and 20% odd. Is it possible to implement such an algorithm in C?
2
1948
by: smugcool | last post by:
hi All , I have got an idea of auto ticket generation through a program. Where it will import any new mail which will arrive at outlook and then it will auto generate a ticket id. I just wanted to interlink outlook with this vb 6.0. I dont know where to start from...as this idea is just an idea. Can anybody help me out how should i go ahead, as i have not done anything yet. Thanx Anup
13
12055
Hiren Joshi
by: Hiren Joshi | last post by:
Hi All, VB 6.0 and MS Access While Saving Record, I want Number to be Generated in following Format 140208-001, 140208-002, 140208-003 . . . etc... You must have noticed that 140208 is today's Date and After the - Last 3 digits are number.
3
2967
by: ramab | last post by:
Hi, im trying to merge 2 databases having the same structure. How do i merge the two databases which have unique identifiers and auto numbers. e.g the first 10 records in table A , it will have auto numbers from 1 to 10 and table B will also have auto numbers from 1 to 10. So will i merged them into 1 table C whereby for e.g table C will have auto numbers from 1 to 20?? Thx in advance.
2
2517
by: Irving Guy | last post by:
Hi all, I’m trying to create a form with 15 fields that generates an auto number in one of those 15 fields. The auto generated number which should display like this – “081-2008-00001” “081-2008-00002” “081-2008-00003” and so on. The first 3 characters of those numbers are pulled in from one of the field, namely “Building #”. The second set of 4 digit numbers are nothing but the current year which gets pulled from another field namely...
5
8084
by: David Wright | last post by:
Hello Everyone I would be grateful if someone could help me with the automatic increment of a field on my subform called ‘Test_SrNo’. I am Using Microsoft Office 2000. The auto entry of the incremented number would help to reduce errors and make data entry simpler. The next record in the Test_SrNo field should not have any entry in it until the text insertion point enters the Test_SrNo field. Example: If the last test serial number...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
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
8851
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...
1
8542
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
7362
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
6181
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
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.