Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
184 Points
253 Posts
May 04, 2012 09:44 PM|LINK
Thanks Loganix for your response.. I am using Datatble in the follwing way
OracleDataAdapter da = new OracleDataAdapter(cmd); DataTable dt = new DataTable("MyResults"); da.Fill(dt);
Is the above code correct
How can I use this datable to read the values because i print them on the excel...
So now i have to loop through the Datable to read as well as export to excel,is it not...How would i do that...Something like below...
foreach (DataRow dr in dt.Rows) { TotalPopulation = Convert.ToInt32(dt.Rows[0]["Population"]);
}
Thank you
akpaga22
Member
184 Points
253 Posts
Re: Looping thorough a query and storing the row values in a Dictonary or someother object
May 04, 2012 09:44 PM|LINK
Thanks Loganix for your response.. I am using Datatble in the follwing way
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataTable dt = new DataTable("MyResults");
da.Fill(dt);
Is the above code correct
How can I use this datable to read the values because i print them on the excel...
So now i have to loop through the Datable to read as well as export to excel,is it not...How would i do that...Something like below...
foreach (DataRow dr in dt.Rows)
{
TotalPopulation = Convert.ToInt32(dt.Rows[0]["Population"]);
}
Thank you