Command Window error when attempting to modify variable

  • Thread starter Thread starter luke_airig
  • Start date Start date
L

luke_airig

Microsoft Development Environment 2003 Version 7.1.3088
Microsoft .NET Framework 1.1 Version 1.1.4322

I am trying to modify the value of a variable in the Command Window
(immediate mode) but I am getting an error.

Here is the code snippet:

U_Appr_InfoDS.U_APPR_INFODataTable dt =
da.GetAllAppraiserInfo(this.LoanNumber);
if (dt.Rows.Count > 0) //My breakpoint is set here...

Here are the contents of the Command Window:

dt.Rows.Count=1
error: cannot assign '1' into 'dt.Rows.Count'

Can anyone give some insight to this problem or recommend a solution?

TIA

Luke
 
[...]
Here are the contents of the Command Window:

dt.Rows.Count=1
error: cannot assign '1' into 'dt.Rows.Count'

Can anyone give some insight to this problem or recommend a solution?

You do not offer enough information for anyone to know for sure, since you
didn't include anything that would tell us for sure what the type of "dt"
is, what type its Rows property is, or how the Count property is to be
used.

However, if it's anything at all like other classes, the Count property is
read-only and you cannot assign anything to it. If you want to change the
number of elements in the Rows collection, you need to do so by adding or
removing items. It's certainly possible to design a class that would do
that for you when you assign a value to the Count property, but it would
be a bad idea and I hope there aren't any .NET classes that do that.

Pete
 
Back
Top