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
Robson Amaral
NA
132
17.3k
Problems with error logging
Apr 10 2018 4:33 PM
I'm having trouble firing the log for the user, in my previous code it was that way and it worked:
privatevoidPreliminaryVerification(
int
count,DataSet ds)
{
bool
imported=
false
;
for
(
int
i =5; i < count; i++)
{
//Verifies that no worksheets with the numSEP entered have not already been imported
if
(!ds.Tables[0].Rows[i].ItemArray[17].ToString().Equals(
""
))
{
if
(aplProcessInterested.listProcInterPorCodSep(
decimal
.Parse(ds.Tables[0].Rows[i].ItemArray[17].ToString())).Count!=0)
{
imported=
true
;
break
;
}
}
else
{
log.Append(
"The cell S"
+(i +1)+
" must be completed.
"
);
arquivoInvalidado =
true
;
}
}
And due to changes it turned out to be that way
:
privatevoidPreliminaryVerification(IEnumerable
data)
bool
imported=
false
;
foreach
(var line
in
data)
{
//Verifies that no worksheets with the numSEP entered have not already been imported
if
(!line.ItemArray[17].ToString().Equals(
""
))
{
if
(aplProcessInterested.listProcInterPorCodSep(
decimal
.Parse(line.ItemArray[17].ToString())).Count!=0)
{
imported=
true
;
break
;
}
}
else
{
log.Append(
"The cell S"
+(1)+
" must be completed.
"
);
fileInvalidated=
true
;
}
However, the log that was displayed to the user ended up incorrectly like this:
Import Log: In the system there is no execution stick associated with the comarca informed in line 1. Please correct the system. In the system there is no execution stick associated with the comarca informed in line 1. Please correct the system.
Here is the problem, but I do not know how to solve it:
log.Append(
"The cell S"
+(1)+
" must be completed.
"
);
Reply
Answers (
15
)
schedule a method by date and time
Few Terms: Bearer Token, access and refresh token, jwt, oaut