string ot ="adas"; if (ot is string) return string; else if (ot is int) return int;
foreach (DataRow dr in datatable.Rows) { int temp; bool flag = int.TryParse(dr["ProjectId"].ToString(), out temp); if (flag == true) { //if success, i.e. ProjectId is int. its value will be in variable temp } else { //if failure, i.e ProjectId is not integer } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)