if ( Convert .ToInt32(dsavailablity.Tables[ 0 ].Rows.Count) > Convert .ToInt32(dsavailablity.Tables[ 0 ].Rows[i])) While i checking this condition i am getting this error " Unable to cast object of type 'System.Data.DataRow' to type 'System.IConvertible'." pls provide me solution for that. You can't convert a whole row to an int! It doesn't work because a row contains zero or more values - and it can't convert more than one value to an int.
Convert.ToInt32(dsavailablity.Tables[0].Rows[i].Cells[0])
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •