bool OrdInValid = false; int ordernum=0; bool isValid = Int32.TryParse(dt.Rows[0].GetField<string>("Col1"), out int Coldata); if (isPOValid) { ordernum= Convert.ToInt32(dt.Rows[0].GetField<string>("Col1")); OrdInValid = false; } else { OrdInValid = true; } }
private int _Order; public int Order { get { return _Order; } set { _Order = value; if (ordernum==0) { OrdInValid = true; } } }
public bool MyMethod(...) { bool itWorked = false; ... do something ... return itWorked; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)