G
Guest
Ok, I have the below function in my web app.
public void advalue_set_tbs_m (DirectoryEntry ad_user, string field, TextBox
tb)
{ //adds value to AD if value is > 0, if not, sets it to null
if (tb.Text.Length > 0)
{
ad_user.Properties[field].Clear();
ad_user.Properties[field].Add(tb.Text);
}
else
{
ad_user.Properties[field].Clear();
}
}
It works fine on my IIS 6 web server. I upgraded my IIS5 server to ASP.Net,
then moved the app over.
I am now getting the below error
System.InvalidOperationException: Operation is not valid due to the current
state of the object
on this line
ad_user.Properties[field].Add(tb.Text);
anyone have any idea whats going on ??
Chris
public void advalue_set_tbs_m (DirectoryEntry ad_user, string field, TextBox
tb)
{ //adds value to AD if value is > 0, if not, sets it to null
if (tb.Text.Length > 0)
{
ad_user.Properties[field].Clear();
ad_user.Properties[field].Add(tb.Text);
}
else
{
ad_user.Properties[field].Clear();
}
}
It works fine on my IIS 6 web server. I upgraded my IIS5 server to ASP.Net,
then moved the app over.
I am now getting the below error
System.InvalidOperationException: Operation is not valid due to the current
state of the object
on this line
ad_user.Properties[field].Add(tb.Text);
anyone have any idea whats going on ??
Chris