TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
cdog
NA
37
0
How is the best way to do this?
May 24 2007 1:48 PM
Hello I have run into an issue. I have a monster of a form I am autopopulating to from a sql database. I have 12 sections in the form that are exactly the same except a number changes on all the fields, I want to write a loop so that I can have it loop through twenty times and populate the data. this is what I have done as a test that was unsuccessful, can anyone help?
for
(
int
a = 0; a < dataTableCOMPSALES.Rows.Count; a++)
{
DataRow
rowCOMPSALES = myDataSetCOMPSALES.Tables[
"ComparableSale"
].Rows[a];
string
typeIndicator = rowCOMPSALES[
"SaleOrListingIndicator"
].ToString();
if
(typeIndicator ==
"S"
)
{
string
saleListingNumber =
"txtSale"
+ a +
"ListingNumber"
;
+saleListingNumber+.Text = rowCOMPSALES[
"_ListingNumber"
].ToString();
}
else
{
string
listListingNumber =
"txtList"
+ a +
"ListingNumber"
;
}
}
Reply
Answers (
3
)
Looking for a cleaner way to do this.
sgen.exe