string messagestatus;
string.TryParse(
Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Status")), out messagestatus
);
I am trying to get the value of status for each row. The status is either sent or save. the error i get is string doesn’t contain a definition for try parse.
I tried to get a integer and it worked perfectly how to solve the above
int msgid;
int.TryParse(
Convert.ToString(DataBinder.Eval(e.Row.DataItem, "MsgID")), out msgid
);
Correct, the string class doesn’t have a TryParse method.
This:
Could be done as: