I hate to keep asking such newbie questions here, but...
I have my data reader working. However, whenever I try to work with integer values from the database, I get this err:
"When casting from a number, the value must be less than infinity"
It happens atCode:while (rdr.Read()) { int shift = (int)rdr["shift"]; string shift2 = shift.ToString(); int empnum = (int)rdr["empnum"]; string empnum2 = empnum.ToString(); string namel = (string)rdr["namel"]; string namef = (string)rdr["namef"]; MessageBox.Show(shift2 + " " + empnum2 + " " + namel + "," + namef); }
int shift = (int)rdr["shift"];
the string casting works fine...




Reply With Quote