A
Amy
Hello,
I've been struggling to learn C#.NET for a while now. I've made some
progress, but I'm easily stumped.
What's stumping me today is this:
I've got a stored procedure (SQL) that returns one row from a table,
and up to 3 rows from another table. I want to read the values of the
three rows into an array, but I can't figure out how to do it. The
code I have compiles, but I suspect it's not quite what I'm looking
for. Basically, how do I iterate through the contactUIDs that are
being returned from the sp?
Thanks in advance,
amy
code:
if (drProject.Read())
{
p = new Project();
p.ProjName = drProject["projName"].ToString();
p.ProjDescrip = drProject["description"].ToString();
p.ProjRequestedDeadline = drProject["requestedDeadline"].ToString();
p.ProjBasecampURL = drProject["basecampURL"].ToString();
p.ProjStatus = drProject["Status"].ToString();
p.ProjStatusID = Int32.Parse(drProject["statusID"].ToString());
p.ProjFreq = drProject["freqtype"].ToString();
p.ProjFreqID = Int32.Parse(drProject["freqID"].ToString());
p.ProjPriority = drProject["priority"].ToString();
p.ProjPriorityID = Int32.Parse(drProject["priorityID"].ToString());
p.ProjDateProposed = drProject["dateProposed"].ToString();
for (int i=0; i<=3; i++)
{
p.ProjContactUIDs =
Int32.Parse(drProject["contactUID"].ToString());
}
}
I've been struggling to learn C#.NET for a while now. I've made some
progress, but I'm easily stumped.
What's stumping me today is this:
I've got a stored procedure (SQL) that returns one row from a table,
and up to 3 rows from another table. I want to read the values of the
three rows into an array, but I can't figure out how to do it. The
code I have compiles, but I suspect it's not quite what I'm looking
for. Basically, how do I iterate through the contactUIDs that are
being returned from the sp?
Thanks in advance,
amy
code:
if (drProject.Read())
{
p = new Project();
p.ProjName = drProject["projName"].ToString();
p.ProjDescrip = drProject["description"].ToString();
p.ProjRequestedDeadline = drProject["requestedDeadline"].ToString();
p.ProjBasecampURL = drProject["basecampURL"].ToString();
p.ProjStatus = drProject["Status"].ToString();
p.ProjStatusID = Int32.Parse(drProject["statusID"].ToString());
p.ProjFreq = drProject["freqtype"].ToString();
p.ProjFreqID = Int32.Parse(drProject["freqID"].ToString());
p.ProjPriority = drProject["priority"].ToString();
p.ProjPriorityID = Int32.Parse(drProject["priorityID"].ToString());
p.ProjDateProposed = drProject["dateProposed"].ToString();
for (int i=0; i<=3; i++)
{
p.ProjContactUIDs =
Int32.Parse(drProject["contactUID"].ToString());
}
}