473,396 Members | 1,998 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,396 software developers and data experts.

automatically generate sr no in textbox

4
hii
i am using vs 10 & access database 7.i develop a small application that store sr no and name.so i want to generate sr no automatically in textbox .
main thing is if there are total 5 sr no saved and suppose i delete sr no 3 then so it can be rearrange
i.e.
1
2
3
4
5
if i delete 3
then it will show
1
2
4
5
but i want to display it
1
2
3
4

i.e.rearrange it


please help me

thanks
Apr 15 '14 #1
2 1189
mcupito
294 256MB
How are you getting "sr no" to the text box?
Apr 15 '14 #2
vkk49
4
hii
i am using the following code to get sr no in textbox




Expand|Select|Wrap|Line Numbers
  1.         Dim dr As OleDbDataReader
  2.         Dim a As Integer
  3.         If Not cn.State = ConnectionState.Open Then
  4.             cn.Open()
  5.         End If
  6.         sqlqry = "select srno from Records"
  7.         cmd = New OleDbCommand(sqlqry, cn)
  8.         dr = cmd.ExecuteReader
  9.         While dr.Read
  10.             a = dr(0)
  11.         End While
  12.  
  13.         Dim i As Integer
  14.  
  15.         If Integer.TryParse(CStr(CDbl(a) + 1), i) Then
  16.             TextBox1.Text = i.ToString
  17.         End If
Apr 16 '14 #3

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

Similar topics

0
by: yongwei | last post by:
I have a user control that used to work fine. But after I moved the project to another folder, one of the user control won't generate a .resouce file after rebuild, and the form contains the user...
1
by: lis0122 | last post by:
I have a table of contacts that is related (one to many) to a table of activities. I want to store a field of "MaxDate" for each contact in the contacts table based on the maximum date of their...
2
by: jmpinto | last post by:
I have a field on a form that I would like to automatically generate a number, in sequential order, each time a new record is created, and be stored in a field. The problem is that I do not want...
111
by: Nate | last post by:
Hello, I am looking for a method to automatically declare variables in C. I'm not sure if there is a good way to do this, but I had something like this in mind... int i; for(i = 1; i < 4;...
6
by: Freddy | last post by:
Hi all, I use a C program to generate lots of data while changing many parameters sometimes. However, I am trying to find a way to let C generate the output file names dependent on a few...
1
by: aekta | last post by:
Hello all, How we get The Value of Dynamic generate TextBox in asp.net? i have a web form and in which i want to create textbox dynamically by click on Button ...Now,on another button click I...
0
by: tomerdr | last post by:
Hi, I am looking for a software like ( MyGeneration or CodeSmith) which can automatically generate a BLL for use with ObjectDataSource. I dont need O\R mapper just a template which generate...
6
by: GLEberts | last post by:
Novice looking for some direction!! I am trying to have a text box autopopulate with a number added to it at the end and I am having a difficult time doing this. Example: (1) I have a combo...
1
by: postman | last post by:
In Access 2007, I'm using bound textboxes on a continuous form to display the contents of each record's memo field. Is there a way to automatically adjust the textbox height to fit the contents? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
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,...

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.