This code gives me this exception saying "Unable to cast object of type 'System.Int32' to type 'System.String'." Please help me.Thanks
Code:sqlcmd.CommandText=("Select count(f_activityName) from dbo.tblStandardActivities WHERE (f_activityName IS NOT NULL)"); sread = sqlcmd.ExecuteReader(); while (sread.Read()) { number_of_activities=Int32.Parse(sread.GetString(0)); }




Reply With Quote