Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai,


I have a TextBox in gridview i need to autogenerate values in textbox(1,2,3...) and store it in database can any one pls help.

Thanks in advance
Posted
Comments
Swetha Bisa 30-Apr-13 5:22am    
6rows will be there and columns will be auto generated

1 solution

Hi,

Please use this code
:-
C#
Random random = new Random();
int randomNumber = random.Next(1001, 9999);
// your text name
txtNumber.Text = randomNumber.ToString(); 


Thanks
 
Share this answer
 
Comments
Swetha Bisa 30-Apr-13 10:19am    
hello Satyendra

Thanks.I have placed my textbox in gridview,so i need to autogenerate the textboxes with numbers in the sequence as (1,2,3....). also i should store these values in database..

Thanks in advance

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900