ADO objects different in C# vs VB?

T

Tina

Again, I'm manually converting a large vb.net project to C# in order to
learn C# and I have another difference I don't understand. I'm using
Framework 1.1.

I have a strongly typed dataset that was generated from a design time Data
Adapter named dsMyDataSet.

I'm in a datagrid delete event and I'm trying to reference the row to
delete.

In vb I my code was dsMyDataSet.myTableName.Rows.Item(e.Item.ItemIndex) but
in C# Rows has no Item Property!

Intellisense shows the objects being different in the two languages.

In C# I have to say dsMyDataSet.myTableName.Rows[e.Item.ItemIndex];

I can understand the syntax being different buy why are the objects
different?

(BTW, I understand that it is not necessary to use the .Item in VB but I
still need to understand why the objects are different)

Thanks,
T
 
D

David Browne

Tina said:
Again, I'm manually converting a large vb.net project to C# in order to
learn C# and I have another difference I don't understand. I'm using
Framework 1.1.

I have a strongly typed dataset that was generated from a design time Data
Adapter named dsMyDataSet.

I'm in a datagrid delete event and I'm trying to reference the row to
delete.

In vb I my code was dsMyDataSet.myTableName.Rows.Item(e.Item.ItemIndex)
but in C# Rows has no Item Property!

Intellisense shows the objects being different in the two languages.

In C# I have to say dsMyDataSet.myTableName.Rows[e.Item.ItemIndex];

I can understand the syntax being different buy why are the objects
different?

(BTW, I understand that it is not necessary to use the .Item in VB but I
still need to understand why the objects are different)


The objects are the same. VB allows explicit access to "indexers", C# does
not.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top