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

AutoGenerate

I am create the auto generate
form
and my Codeis

Expand|Select|Wrap|Line Numbers
  1.  int n = 3;
  2.         string Record = string.Empty;
  3.         protected void Page_Load(object sender, EventArgs e)
  4.         {
  5.             for (int i = 1; i <= n; i++)
  6.             {
  7.                 for (int j = 1; j <= 2; j++)
  8.                 {
  9.                     Record += " P " + j + i.ToString(" 000 ") + "</br>";
  10.                 }
  11.             }
  12.             lblMessage.Text = Record;
  13.         }
my output is
Expand|Select|Wrap|Line Numbers
  1. P 1 001 
  2. P 2 001 
  3. P 1 002 
  4. P 2 002 
  5. P 1 003 
  6. P 2 003 
But this output is error
correct output
Expand|Select|Wrap|Line Numbers
  1. P 1 001 
  2. P 1 002 
  3. P 1 003
  4. P 2 001 
  5. P 2 002 
  6. P 2 003
how to do?
Mar 11 '15 #1
1 1505
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code or formatted data.

Your loops are in the wrong order, flip them.
Mar 11 '15 #2

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

Similar topics

2
by: m_evergreen | last post by:
I would like the numbers 000001 to 999999 to autogenerate in a new database. I will be transfering information from another database and in that database the numbers 000001 to 010000 are already...
0
by: Jason Coyne Gaijin42 | last post by:
I have seen several people looking for a way to access the Columns collection when using the AutoGenerate = true option. Some people have gotten so far as to find the private autoGenColumnsArray...
2
by: Jason Coyne Gaijin42 | last post by:
I have seen several people looking for a way to access the Columns collection when using the AutoGenerate = true option. Some people have gotten so far as to find the private autoGenColumnsArray...
1
by: ypul | last post by:
Hi , Getting to the point directly, my query output doesnt have fixed columns , so I choosed "autogenerate columns" datagrid. I assign this dataset to my datagrid, but now I want my data should...
2
by: serge calderara | last post by:
Dear all, I have a datagrid which bind to a dataset object Datagrid autogenerate propertie is set to True. I need to create the first column of my grid to be used as an hyperlink and sending...
2
by: hazz | last post by:
in a databound scenario I have a database column value that is of type varchar with 3 discrete text values. Binding to this table column with autogenerated columns displays the text values in a...
1
by: Dhruba Bandopadhyay | last post by:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm....
0
by: yahiko | last post by:
Hello We have a large table of about 1.5M rows inserted per week. The expecte size is near 5 GBys per year. is there a form to autogenerate a partition by day in this table??? We have a date...
3
by: Brett Wickard | last post by:
Anyone know of a good way to autogenerate stored procedure parameters to put into c# code? I don't need to do it on the fly, just while coding. I've got some SPs with a lot of parameters, so it...
2
by: aarti83 | last post by:
hello, i m developing a small project. but i m having some problems in that. plz if any one can help i will be very thankfull. i m using access as backend. 1)i want to auto generate nos in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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...

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.