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
Narasiman nar
NA
64
22.1k
how to validate dict in c#
May 28 2018 8:10 AM
My code as follows
int columnindex = 43;
List<string> lst = new List<string>();
foreach (DataRow row in dtFarmerFarmReports.Rows)
{
var dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(row["farm_detailsdata"].ToString());
if (dict!=null && dict!= string.Empty)
{
string str = string.Empty;
lst.AddRange(dict.Keys);
}
}
when i run shows error as follows
Operator '!=' cannot be applied to operands of type 'Dictionary<string, string>' and 'string'
how to fix this error.
Reply
Answers (
3
)
how to validate the null value in dictionary in c#
Validate dict value is empty in c#