473,734 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to access parameterized property in C#?

i posted this problem on microsoft.publi c.excel.program ming, but there's
no one replied till now. because this issue is time critical, i put it
here to try my fortune :)

------------------------------------------------------------------------

I am just a fresh man for C# programming, but i found that C# have no
support for optional parameter or parameterized property, which are
supported in VB.NET.

everybody kowns that Office programming is based on vb style language,
so now i have to access parameterized properties such as
Excel.WorkSheet .Cells(X, Y)
i was told that Cells is a property, not a method. i wonder how to pass
parameters to a property like Cells, if there's no way, logic will be
more complicated i think.

does some people have some good suggestions about optional parameters
and parameterized properties in Office programming, would you like to
shed some light? :)

thanks for listenning
Jul 21 '05 #1
7 3670
Wayne Wood <sa*****@gmail. com> wrote in news:ec******** ******@TK2MSFTN GP14.phx.gbl:
does some people have some good suggestions about optional parameters
and parameterized properties in Office programming, would you like to
shed some light? :)


COM is different than how C# handles issues itslef. For COM you pass Missing to specify the
paraameter is not being used.

For indexed properties, use [ ] instead of ( )
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
Jul 21 '05 #2
i mean, you know, there are so many "parameteri zed properties" and
"optional arguments" in Excel Object Model or so, and i DID deal with
that well in VB.NET, because of its support for these concepts. i also
know there are really some differences between VB.NET and C#, but after
all, they are designed for the same platform, so are you telling me that
something that can be done with VB.NET can not be done with C#? that's
critical, i think i have no time to rewrite the whole code :(

by the way, did you mean COM can support parameterized properties, but
..net can not because of another different policy?

Chad Z. Hower aka Kudzu дµÀ:
COM is different than how C# handles issues itslef. For COM you pass Missing to specify the
paraameter is not being used.

For indexed properties, use [ ] instead of ( )
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/

Jul 21 '05 #3
Wayne Wood <sa*****@gmail. com> wrote in
news:Oy******** ******@TK2MSFTN GP10.phx.gbl:
i mean, you know, there are so many "parameteri zed properties" and
"optional arguments" in Excel Object Model or so, and i DID deal with
that well in VB.NET, because of its support for these concepts. i
also know there are really some differences between VB.NET and C#, but
after all, they are designed for the same platform, so are you telling
me that something that can be done with VB.NET can not be done with
C#? that's critical, i think i have no time to rewrite the whole code
This is one area that VB is eaiser. VB is looser bound than C# and does many things easier when
working with COM. I nearly exclusively use C#, but when I build COM clients or COM servers
especially I use VB because its much eaiser.
by the way, did you mean COM can support parameterized properties, but
net can not because of another different policy?


Huh?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
Jul 21 '05 #4
Thanks a lot, i thought they were basically same :)

Chad Z. Hower aka Kudzu дµÀ:
Wayne Wood <sa*****@gmail. com> wrote in
news:Oy******** ******@TK2MSFTN GP10.phx.gbl:
i mean, you know, there are so many "parameteri zed properties" and
"optional arguments" in Excel Object Model or so, and i DID deal with
that well in VB.NET, because of its support for these concepts. i
also know there are really some differences between VB.NET and C#, but
after all, they are designed for the same platform, so are you telling
me that something that can be done with VB.NET can not be done with
C#? that's critical, i think i have no time to rewrite the whole code

This is one area that VB is eaiser. VB is looser bound than C# and does many things easier when
working with COM. I nearly exclusively use C#, but when I build COM clients or COM servers
especially I use VB because its much eaiser.

Jul 21 '05 #5
Wayne Wood <sa*****@gmail. com> wrote in
news:Og******** ******@TK2MSFTN GP10.phx.gbl:
Thanks a lot, i thought they were basically same :)


Mostly they are, but there are some key differences. C# has a lot of things that VB doesnt, while
the reverse is not so true.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/
Jul 21 '05 #6
could you please take some for example? i'm so fresh to C# really :)

Chad Z. Hower aka Kudzu дµÀ:
Wayne Wood <sa*****@gmail. com> wrote in
news:Og******** ******@TK2MSFTN GP10.phx.gbl:
Thanks a lot, i thought they were basically same :)

Mostly they are, but there are some key differences. C# has a lot of things that VB doesnt, while
the reverse is not so true.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/

Jul 21 '05 #7
Wayne Wood <sa*****@gmail. com> wrote in
news:#y******** ******@TK2MSFTN GP14.phx.gbl:
could you please take some for example? i'm so fresh to C# really :)


Google will turn up huge discussions on this, in fact there was on just a few days ago.

VB: Easier COM support, both using clients and building servers,
Optional arguments

C#: Implicit overloads, operator overloads, using statement, and a few others that esape me right
now.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
Jul 21 '05 #8

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

Similar topics

1
2275
by: Antoine Pitrou | last post by:
Hi, I've been looking at writing parameterized metaclasses and here are the two solutions I've come to: (my goal was to build a way to automatically add a hash function that would take into account a selected list of object attributes) 1. all-in-one metametaclass: class Autohash2(type):
1
6076
by: gary b | last post by:
Hello When I use a PreparedStatement (in jdbc) with the following query: SELECT store_groups_id FROM store_groups WHERE store_groups_id IS NOT NULL AND type = ? ORDER BY group_name
0
3025
by: totierne | last post by:
comp.databases.ms-access, I want to know how to use Oracle views with session variables in Access. The parameterised views in access, are migrated to views with per session variables. The open questions: How to display a resultset
8
12926
by: deko | last post by:
I'm trying to open a Recordset based on a parameterized query. I'm kind of new to parameterized queries, so I'm sure I'm missing something simple. Set qdfs = db.QueryDefs Set qdf = qdfs("qryInvoices") qdf.Parameters("prmInv") = strInvoice qdf.Parameters("prmCid") = lngCustomerID Set rst = db.OpenRecordset("qryInvoices")
1
1350
by: Preston | last post by:
hello all... My friend using vb.net made a DLL file which contains a Property Kkk(ByVal key As Object) in it, I use CSharp and reference this DLL file, but in csharp object browser, there is no Kkk property, cause csharp doesn't support parameterized scalar properties?? Then how can I use the Kkk property?? (I only know that if Csharp use Indexer, VB.net use Item as the property name.)
0
1142
by: Ahmet GUNES | last post by:
Hi all, Although I tried several different ways, I wasn't able to succeed databinding a parameterized property. Can anyone help? Thanks in advance, AG In a form with two text boxes on it, say in Load event, I write the following code:
14
454
by: Wayne Wood | last post by:
i posted this problem on microsoft.public.excel.programming, but there's no one replied till now. because this issue is time critical, i put it here to try my fortune :) ------------------------------------------------------------------------ I am just a fresh man for C# programming, but i found that C# have no support for optional parameter or parameterized property, which are supported in VB.NET.
5
2525
by: elena | last post by:
Hi, All I need help: I have VS .NET 2003 version 1.1 (C#) and MS Access What will be the best way to create parameterized reports? Please, help I don't know where to start, any linkss to this topic will be appreciated
1
1345
by: Yaman Gupta | last post by:
SIR PLS KNOW TO ME WHAT IS .NET PARAMETERIZED PROPERTY AND DEFAULT PROPERTY .and GIVE ME SOME EXAMPLE s Regards Yaman Gupta
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
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
9449
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
9310
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
9236
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
9182
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...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3261
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

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.