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
Murali Kris
1.5k
254
48.7k
how to clear previous values during looping.
Nov 5 2018 11:10 PM
Hi,
using below code i can read datatable row value. when it loops 2nd row its printing 1st row values also, if it at 3rd possion(3rd row posstion) it is printing 1st row data, 2nd row data and 3rd row data.
how to get only current row vaues , how to clear previous values during looping.
foreach (DataRow row in dt.Rows)
{
char[] mychars = { ';' }; // it has to split if it find semicolon.
List<string> textn = new List<string>();
textn.Clear();
textn = new List<string>(new[] { row["Source-USER/GRP PERMISSIONS"].ToString() });
string combindedString = null;
combindedString = string.Join(Environment.NewLine, textn.ToArray());
string[] names = null;
names = combindedString.Split(mychars, StringSplitOptions.None);
foreach (var item in names)
{
MessageBox.Show(item.ToString());
}
}
Reply
Answers (
2
)
How Can I Add Image In Gmail Body Panel MVC 5
Chat bot recognize facebook users and say hello fbreg.name