i found where it is happening and i have a patch in my own system that
prevents the error but will potentially cause other problems.
for now i can point to where it is happening (for me) We may need to
rewrite how the strings are split into arrays
*******
I want to be clear, this is not a solution, just a way around it for
the purpose of changing how the strings are split.
******
for (int i = 0; i < nRowsCount; i++)
{
dr = dtContatct.NewRow();
dr[0] = alFirstName[i].ToString();
dr[1] = alLastName[i].ToString();
//dr[2] = alScreenName[i].ToString();
dr[2] = alEmail[i].ToString();
//dr[4] = alPhone[i].ToString();
dtContatct.Rows.Add(dr);
}
caused by uneven array length
to catch the max and pad :
add these two lines (i converted mine to 3.5, pardon the var's)
var iMax = alEmail.Count > alFirstName.Count ?
alEmail.Count : alFirstName.Count;
iMax = iMax > alLastName.Count ? iMax : alLastName.Count;
then for each of these change: (also do the same for email and last
name
if (alFirstName.Count == 0)
{
for (int i = alFirstName.Count; i < nRowsCount; i+
+)
{
alFirstName.Add
(string.Empty);
}
}
to
if (alFirstName.Count < iMax)
{
for (int i = alFirstName.Count; i < iMax; i++)
{
alFirstName.Add
(string.Empty);
}
}
then finally
for (int i = 0; i < iMax; i++)
{
if (i >= 296)
{
string str = string.Empty;
}
dr = dtContatct.NewRow();
dr[0] = alFirstName[i].ToString();
dr[1] = alLastName[i].ToString();
//dr[2] = alScreenName[i].ToString();
dr[2] = alEmail[i].ToString();
//dr[4] = alPhone[i].ToString();
dtContatct.Rows.Add(dr);
}
}
On Dec 5, 11:41 pm, Suresh <
sureshsof...@gmail.com> wrote:
> I downloaded the source code fromhttp://
www.ideabubbling.com/contactsreader.aspx.