DataRow Problem
-
Hello once again! I was wondering why i cant seem to add data to my datarow. here's the code snippet im hoping if you guys could help me out on this one...
DataTable dt = new DataTable();
string[] arrEmpIDs = strEmpID.Split(',');
for (int q=0; qthe array holds 10 strings and the function works fine (database retrieval). Well the program hangs before
dt.Rows.Add(dr);
and im totaly clueless why.An advance thanx for all your posts! Kampai!!!
Aim small, miss small...
-
Hello once again! I was wondering why i cant seem to add data to my datarow. here's the code snippet im hoping if you guys could help me out on this one...
DataTable dt = new DataTable();
string[] arrEmpIDs = strEmpID.Split(',');
for (int q=0; qthe array holds 10 strings and the function works fine (database retrieval). Well the program hangs before
dt.Rows.Add(dr);
and im totaly clueless why.An advance thanx for all your posts! Kampai!!!
Aim small, miss small...
Looks like you are in an infinite loop - is this what you are trying to do? DataTable dt = new DataTable(); string[] arrEmpIDs = strEmpID.Split(','); DataRow dr = dt.NewRow(); for (int q=0; q < arrEmpIDs.Length; q++) { dr[q] = objDSPHContribRep.fgetEmpPhilHealthInfo(arrEmpIDs[q]); } dt.Rows.Add(dr); return dt; Jon Humphreys ActivePlanet Software Bangkok, Thailand
-
Looks like you are in an infinite loop - is this what you are trying to do? DataTable dt = new DataTable(); string[] arrEmpIDs = strEmpID.Split(','); DataRow dr = dt.NewRow(); for (int q=0; q < arrEmpIDs.Length; q++) { dr[q] = objDSPHContribRep.fgetEmpPhilHealthInfo(arrEmpIDs[q]); } dt.Rows.Add(dr); return dt; Jon Humphreys ActivePlanet Software Bangkok, Thailand
Hi! Thanx for the post! Im not arguing or anything i was just wondering if i remove
dt.Rows.Add(dr);
from the loop won't the program just add 1 long row instead of 10 short rows? oh yeah and since the program originaly hangs atdr[q] = objDSPHContribRep.fgetEmpPhilHealthInfo(arrEmpIDs[q]);
upon debugging what would prevent it from stalling this time? pardon me for asking so much questions im still new at this and im thankful for al your helps:-D Aim small, miss small...