473,657 Members | 2,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'System.Data.Da taRowCollection ' does not contain a definition for 'Item'

Hi all,

I have 2 asp .net 2.0 projects currently being developed. One is in
VB .Net and the other in C#. In the VB .Net project I can cross-reference
a datatable object using the datatable.rows. item(i).item(j) , but in the
C# project I can not do it. That is, I do get:

error 'System.Data.Da taRowCollection ' does not contain a definition for
'Item'
They are running under the same development evironment. (i.e. Asp .Net 2.0)
Does anyone know what can be happening?

Thanks,

Carlos.
Nov 7 '06 #1
3 7717
I think in C# you should be able to say:
datatable.rows[i][j]
and that should return the proper object

Carlos wrote:
Hi all,

I have 2 asp .net 2.0 projects currently being developed. One is in
VB .Net and the other in C#. In the VB .Net project I can cross-reference
a datatable object using the datatable.rows. item(i).item(j) , but in the
C# project I can not do it. That is, I do get:

error 'System.Data.Da taRowCollection ' does not contain a definition for
'Item'
They are running under the same development evironment. (i.e. Asp .Net 2.0)
Does anyone know what can be happening?

Thanks,

Carlos.
Nov 7 '06 #2
Hi Carol,

In C# you need say like this;

DataRowCollecti on oDataRow = new DataRowCollecti on();
oDataRow[i][j];

Thanks,
Thiagarajan Rajendran.
Carlos wrote:
Hi all,

I have 2 asp .net 2.0 projects currently being developed. One is in
VB .Net and the other in C#. In the VB .Net project I can cross-reference
a datatable object using the datatable.rows. item(i).item(j) , but in the
C# project I can not do it. That is, I do get:

error 'System.Data.Da taRowCollection ' does not contain a definition for
'Item'
They are running under the same development evironment. (i.e. Asp .Net 2.0)
Does anyone know what can be happening?

Thanks,

Carlos.
Nov 7 '06 #3

The "indexer" in VB.net is called by .Item(someInt)

ex:

myCollection.It em(someInt)

in C#, the indexer is called like this

myCollection[someInt]; // no use of the work "Item" here.


"Carlos" <ch******@yahoo .comwrote in message
news:eH******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi all,

I have 2 asp .net 2.0 projects currently being developed. One is in
VB .Net and the other in C#. In the VB .Net project I can cross-reference
a datatable object using the datatable.rows. item(i).item(j) , but in the
C# project I can not do it. That is, I do get:

error 'System.Data.Da taRowCollection ' does not contain a definition for
'Item'
They are running under the same development evironment. (i.e. Asp .Net
2.0)
>

Does anyone know what can be happening?

Thanks,

Carlos.


Nov 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2395
by: Carlos Ribeiro | last post by:
Hello all, I'm posting this to the list with the intention to form a group of people interested in this type of solution. I'm not going to spam the list with it, unless for occasional and relevant announcements. If you're interested, drop me a note. But if for some reason you think that this discussion is fine here at the c.l.py, please let me know. ** LONG POST AHEAD **
1
2798
by: Ian Payne | last post by:
Documentation says it does: Quickwatch lists it (but <cannot view indexed property> as expected) So how come the compiler throws an error? I can of course work round it (in C#) with myMatches, but tend to use the Item property by default. Ian
2
5672
by: Scott Adams | last post by:
When calling the Find function of a DataRowCollection, one has two options: Overloads Public Function Find(ByVal key As Object) As DataRow or Overloads Public Function Find(ByVal keys() As Object) As DataRow This function is easy to use if the primary key of your DataTable consists of only one field. How can you use the Find functions if the primary key consists of two database fields (composite key)?
4
7285
by: emma middlebrook | last post by:
Hi Straight to the point - I don't understand why System.Array derives from IList (given the methods/properties actually on IList). When designing an interface you specify a contract. Deriving from an interface and only implementing some of it means something is wrong: either the interface specification is wrong e.g. not minimal or the derivation is wrong e.g. the type can't actually honour this contract.
1
6785
by: Luis Esteban Valencia | last post by:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0117: 'System.Data.DataTable' does not contain a definition for 'WriteXml' Source Error:
1
7832
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I am note sure what to do because all propertiers work, except the System.Data.DataColumn.. I didn't write any code by hand and used the visual studio to set the properties..
2
2294
by: mfunkmann | last post by:
Hi there! I have a problem here: I am using System.Data.Column and the Designer wrote follwing Code for me: this.System = new System.Data.DataColumn(); So far great, but furthermore I was setting properties with the Design it generated follwing Code:
0
995
by: thisisuniqueuserid | last post by:
throwing error " 'Outlook.Items' does not contain a definition for 'Item' " in asp.net while I added references for Interop.Outlook,Office still showing same error. If any body can help Thanks in advance Dhananjay
12
6546
by: Nelluru | last post by:
Hi, I am using Office XP PIA's to read a word document. I am able to read the whole content. The problem is that i want to get a particular word in the document instead of the whole content. Will the _Document.Words property is useful to retrieve word by word form the document??? If it is possible, How to use it??? thanks Nelluru
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8498
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.