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
Farhan Shariff
NA
933
242.2k
print ienumerable in text file c#
May 20 2014 3:47 AM
I am matching two string list (Die_ID_refrence , Die_ID_real) I want to print all the string Values present in string list (Reference) and not in (Real) in to a Text file
//---------------------------------------------------------------------------------------
List<String> Die_ID_refrence = new List<String>(); //List stores All Die_ID from Reference sheet
for (int a = 0; a < table5.Rows.Count; a++)
{
Die_ID_refrence.Add(table5.Rows[a]["Die_ID"].ToString());
}
//------------------------------------------------------------------------------------------
List<String> Die_ID_real = new List<String>(); //List stores All Die_ID from Reference sheet
for (int b = 0; b < table3.Rows.Count; b++)
{
Die_ID_real.Add(table3.Rows[b]["Die_ID"].ToString());
}
//---------------------------------------------------------------------------------------
IEnumerable<object> result = Die_ID_refrence.ToArray().Except(Die_ID_real.ToArray()); //Gives you Die_ID in one (Reference) not two (Real)
var collection = result as IEnumerable;
if (collection != null)
{
foreach (var item in collection)
{
// I want to print the item in to a text file
File.AppendAllLines(@"C:\Delta Sigma\Log.txt", ---------------------------);
//how to print this
}
Reply
Answers (
2
)
Regular Expression today 4
Grouping is not working for my kendo listview