DataRaw class
-
Hi, I have simular code like below the type object in dr.ItemArray[0] is Int16 but I can not assigne the dr.ItemArray[0] to i (int) i = dr.ItemArray[0]; throws exception Is there a method of assigning DataRow fields of number types to integer variables; To achieve my goal I'm converting the object to string and then back to integer i = int.Parse(n.ToString()); I think that this can not be the correct way. Thank you in advance, Seval YILMAZ object n; int i; foreach (DataRow dr in clGlobal.ds.Tables["login1"].Rows) { n = dr.ItemArray[0]; i = int.Parse(n.ToString()); }
-
Hi, I have simular code like below the type object in dr.ItemArray[0] is Int16 but I can not assigne the dr.ItemArray[0] to i (int) i = dr.ItemArray[0]; throws exception Is there a method of assigning DataRow fields of number types to integer variables; To achieve my goal I'm converting the object to string and then back to integer i = int.Parse(n.ToString()); I think that this can not be the correct way. Thank you in advance, Seval YILMAZ object n; int i; foreach (DataRow dr in clGlobal.ds.Tables["login1"].Rows) { n = dr.ItemArray[0]; i = int.Parse(n.ToString()); }
n = Convert.ToInt32(dr[0]);
Ian Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - me