Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Reply
How is the best way to do this?
cdog
May 24 2007 1:48 PM
1.7k
Reply
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"
;
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Looking for a cleaner way to do this.
Parse Values in C# Compact Framework