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
Carl Potter
NA
6
30.1k
write to variables to a file which increment
Nov 20 2010 10:46 AM
I would like to write two variables to a file from two for loops like writing a two dimensional array to file. so if I have a two dimension array 3 by 3 then if I was two write it to a file then it would look somethiing like this.
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
I have got the code below working sort of right I just need to combine the results of both loop into one writer.WriteLine nothing I try seems to work.
string filePath = @"C:\\seating plan one.txt";
using (StreamWriter writer = new StreamWriter(filePath, true))
for (int i = 0; i < 100; i++)
{
writer.WriteLine("i = " + i);
for (int j = 0; j < 10; j++)
{
writer.WriteLine("j = " + j);
}
}
so results from i and j together writer.WriteLine(i, j);
I have tried lots of different file.* but not seems to resolve problem. Can any one help thanks in advance.
Reply
Answers (
3
)
Add Row To Bound DGV By Textbox
I need a quick bit of help with DataAdapters...