DataRow["columnname", DataRowVersion.Original] error in VS IDE

  • Thread starter Thread starter Jiho Han
  • Start date Start date
J

Jiho Han

I am trying to examine the value of a column in the command window by using
the indexer like:

? someRow["COMPANY", DataRowVersion.Original]

and it returns an error that says,

object 'someRow' doesn't have an indexer. It doesn't work in Watch window
either.

The overload without the version info works like a charm. I see that the
overloads with the version parameter are readonly (get only). Would that
be the issue?
Anyone else seen this?

Jiho Han
Senior Software Engineer
Infinity Info Systems
The Sales Technology Experts
Tel: 212.563.4400 x216
Fax: 212.760.0540
(e-mail address removed)
www.infinityinfo.co
 
Jiho,

I don't know in what method you use it, however probably you only have to
move the bracket a little bit.

someRow["COMPANY"], DataRowVersion.Original
:-)

Cor
Jiho Han said:
I am trying to examine the value of a column in the command window by using
the indexer like:

? someRow["COMPANY", DataRowVersion.Original]

and it returns an error that says,

object 'someRow' doesn't have an indexer. It doesn't work in Watch window
either.

The overload without the version info works like a charm. I see that the
overloads with the version parameter are readonly (get only). Would that
be the issue?
Anyone else seen this?

Jiho Han
Senior Software Engineer
Infinity Info Systems
The Sales Technology Experts
Tel: 212.563.4400 x216
Fax: 212.760.0540
(e-mail address removed)
www.infinityinfo.com
 
Cor,

I'm trying to use it in the IDE to examine the value of a row. The syntax
you stated seems strange.
If I were to use it in the actual code to examine a value,

someRow["COMPANY", DataRowVersion.Original]

is the correct syntax. The IDE just doesn't seem to understand this. However,
when I tried your syntax, the IDE gave me a different error saying:

identifier 'DataRowVersion' is out of scope.

Thanks
Jiho,

I don't know in what method you use it, however probably you only have
to move the bracket a little bit.

someRow["COMPANY"], DataRowVersion.Original

:-)

Cor
Jiho Han said:
I am trying to examine the value of a column in the command window by
using the indexer like:

? someRow["COMPANY", DataRowVersion.Original]

and it returns an error that says,

object 'someRow' doesn't have an indexer. It doesn't work in Watch
window either.

The overload without the version info works like a charm. I see that
the
overloads with the version parameter are readonly (get only). Would
that
be the issue?
Anyone else seen this?
Jiho Han
Senior Software Engineer
Infinity Info Systems
The Sales Technology Experts
Tel: 212.563.4400 x216
Fax: 212.760.0540
(e-mail address removed)
www.infinityinfo.co
 
Jiho,

We see only a very small part of your code.

A complete dataset exist, if it is about the first table, in that the first
datarow and in that the first dataitem in C# notation

ds.Table[0].DataRow[0].Item[0];

Where in the Table the zero can be a tablename and the item a datacolumn, an
integer or a string representing the datacolumnname

Cor

Cor,

I'm trying to use it in the IDE to examine the value of a row. The syntax
you stated seems strange.
If I were to use it in the actual code to examine a value,

someRow["COMPANY", DataRowVersion.Original]

is the correct syntax. The IDE just doesn't seem to understand this.
However, when I tried your syntax, the IDE gave me a different error
saying:

identifier 'DataRowVersion' is out of scope.

Thanks
Jiho,

I don't know in what method you use it, however probably you only have
to move the bracket a little bit.

someRow["COMPANY"], DataRowVersion.Original

:-)

Cor
Jiho Han said:
I am trying to examine the value of a column in the command window by
using the indexer like:

? someRow["COMPANY", DataRowVersion.Original]

and it returns an error that says,

object 'someRow' doesn't have an indexer. It doesn't work in Watch
window either.

The overload without the version info works like a charm. I see that
the
overloads with the version parameter are readonly (get only). Would
that
be the issue?
Anyone else seen this?
Jiho Han
Senior Software Engineer
Infinity Info Systems
The Sales Technology Experts
Tel: 212.563.4400 x216
Fax: 212.760.0540
(e-mail address removed)
www.infinityinfo.com
 
Maybe I am not explaining myself clearly. Not a surprise to me but...

in my "code", someRow is an instance of DataRow.

In the SDK doc, DataRow class provides six different indexers (in C#) anyway.

public object this[string] {get; set;}
public object this[DataColumn] {get; set;}
public object this[int] {get; set;}
public object this[string, DataRowVersion] {get;}
public object this[DataColumn, DataRowVersion] {get;}
public object this[int, DataRowVersion] {get;}

All I am trying to do is to use the 4th overload to view the original version
of a column, in a command window from the IDE while debugging.
And in that situation, it seems that the IDE only recognizes the first three
overloads while giving me the error on the bottom three.

Hope this clears up the issue I am troubleshooting...
Thanks!
Jiho,

We see only a very small part of your code.

A complete dataset exist, if it is about the first table, in that the
first datarow and in that the first dataitem in C# notation

ds.Table[0].DataRow[0].Item[0];

Where in the Table the zero can be a tablename and the item a
datacolumn, an integer or a string representing the datacolumnname

Cor

Cor,

I'm trying to use it in the IDE to examine the value of a row. The
syntax
you stated seems strange.
If I were to use it in the actual code to examine a value,
someRow["COMPANY", DataRowVersion.Original]

is the correct syntax. The IDE just doesn't seem to understand this.
However, when I tried your syntax, the IDE gave me a different error
saying:

identifier 'DataRowVersion' is out of scope.

Thanks
Jiho,

I don't know in what method you use it, however probably you only
have to move the bracket a little bit.

someRow["COMPANY"], DataRowVersion.Original

:-)

Cor
"Jiho Han" <[email protected]> schreef in bericht
I am trying to examine the value of a column in the command window
by using the indexer like:

? someRow["COMPANY", DataRowVersion.Original]

and it returns an error that says,

object 'someRow' doesn't have an indexer. It doesn't work in Watch
window either.

The overload without the version info works like a charm. I see
that
the
overloads with the version parameter are readonly (get only).
Would
that
be the issue?
Anyone else seen this?
Jiho Han
Senior Software Engineer
Infinity Info Systems
The Sales Technology Experts
Tel: 212.563.4400 x216
Fax: 212.760.0540
(e-mail address removed)
www.infinityinfo.com
 
Jiho,

I did not know this overloaded function. Glad I know it now.

This code works for me.
\\\
DataTable dt = new DataTable();
dt.Columns.Add("COMPANY", System.Type.GetType("System.String"));
dt.LoadDataRow(new object[] {"Original"},true);
dt.Rows[0][0] = "NewText";
DataRow someRow = dt.Rows[0];
MessageBox.Show(someRow["COMPANY", DataRowVersion.Original].ToString())
////

I hope this helps,

Cor
 
Yeah, but try to use that method in the IDE, inside the command window, or
in a watch window.

It won't work.
 
Jiho,

Did you try it, it works for me in the IDE.

Cor

Jiho Han said:
Yeah, but try to use that method in the IDE, inside the command window, or
in a watch window.

It won't work.
Jiho,

I did not know this overloaded function. Glad I know it now.

This code works for me.
\\\
DataTable dt = new DataTable();
dt.Columns.Add("COMPANY", System.Type.GetType("System.String"));
dt.LoadDataRow(new object[] {"Original"},true);
dt.Rows[0][0] = "NewText";
DataRow someRow = dt.Rows[0];
MessageBox.Show(someRow["COMPANY",
DataRowVersion.Original].ToString())
////
I hope this helps,

Cor
 
while debugging, inside the command window?

For me, I get "object 'someRow' doesn't have an indexer" error. Hey, what's
going on!

Thanks for the confirmation, Cor.
Jiho,

Did you try it, it works for me in the IDE.

Cor

Yeah, but try to use that method in the IDE, inside the command
window, or in a watch window.

It won't work.
Jiho,

I did not know this overloaded function. Glad I know it now.

This code works for me.
\\\
DataTable dt = new DataTable();
dt.Columns.Add("COMPANY", System.Type.GetType("System.String"));
dt.LoadDataRow(new object[] {"Original"},true);
dt.Rows[0][0] = "NewText";
DataRow someRow = dt.Rows[0];
MessageBox.Show(someRow["COMPANY",
DataRowVersion.Original].ToString())
////
I hope this helps,
Cor
 
Jiho,

Mostly is this a upper/lower case question, however because that you do use
C# do I doubt in that.

Cor

Jiho Han said:
while debugging, inside the command window?

For me, I get "object 'someRow' doesn't have an indexer" error. Hey,
what's going on!

Thanks for the confirmation, Cor.
Jiho,

Did you try it, it works for me in the IDE.

Cor

Yeah, but try to use that method in the IDE, inside the command
window, or in a watch window.

It won't work.

Jiho,

I did not know this overloaded function. Glad I know it now.

This code works for me.
\\\
DataTable dt = new DataTable();
dt.Columns.Add("COMPANY", System.Type.GetType("System.String"));
dt.LoadDataRow(new object[] {"Original"},true);
dt.Rows[0][0] = "NewText";
DataRow someRow = dt.Rows[0];
MessageBox.Show(someRow["COMPANY",
DataRowVersion.Original].ToString())
////
I hope this helps,
Cor
 
Back
Top