yes , at the top we declare variables , byval fname as string , here you can change string to integer , and also in your for loop where you are getting values from the grid , use val(datagrid.item(0,i).tostring()) , it will work perfectly , but if you have prob with that please post your full code , so that i can better ans you.
Regards