473,327 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Plz tell me correct answer

I have the following code in vb.net,which work very fine,but i want to convert it in C#.net(which is also pasted below),But it it have error on "item" and on "Index"
some one help me plz

VB.Net Code
Expand|Select|Wrap|Line Numbers
  1. Default Public Shadows Property Item(ByVal Index As Integer) As ColumnBound
  2.         Get
  3.             Return CType(MyBase.Item(Index), ColumnBound)
  4.         End Get
  5.         Set(ByVal Value As ColumnBound)
  6.             MyBase.Item(Index) = Value
  7.         End Set
  8.     End Property 
C#.Net Code
Expand|Select|Wrap|Line Numbers
  1. public new ColumnBound Item
  2.     {
  3.         get
  4.         {
  5.             return (ColumnBound)base.Item[Index];
  6.         }
  7.         set
  8.         {
  9.             base.Item[Index] = value;
  10.         }
  11.     }
Sep 27 '08 #1
3 1076
kenobewan
4,871 Expert 4TB
In vb you have the Index As Integer made available to the function. What is the value of index in your c# code?
Sep 27 '08 #2
In vb you have the Index As Integer made available to the function. What is the value of index in your c# code?



I have not given any value to Index in C#.thnx for reply
if u find any solution than plz inform me
Sep 29 '08 #3
Plater
7,872 Expert 4TB
Is that a class or a property? If it's a property, there is no "new" keyword.
Expand|Select|Wrap|Line Numbers
  1. public ColumnBound Item 
  2.     { 
  3.         get 
  4.         { 
  5.             return (ColumnBound)base.Item[Index]; 
  6.         } 
  7.         set 
  8.         { 
  9.             base.Item[Index] = value; 
  10.         } 
  11.     } 
  12.  
However, you will need to have declared Index somewhere inside the class that has that property, so that the Item value can be retrieved.
Sep 29 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
5
by: mscirri | last post by:
The code below is what I am using to asynchronously get data from a PocketPC device. The data comes in fine in blocks of 1024 bytes but even when I send no data from the PocketPC constant blocks of...
13
by: Dr. Zharkov | last post by:
Hello. A problem in the following. In VB .NET 2003 we create the project and in file Form1.vb the following code is written down: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As...
12
by: joanne | last post by:
how to tell application version after i installed it at client side? i did make the version and product code while doing the packaging and deployment. Thanks a lot.
18
by: shilpa.saraogi | last post by:
Heya all, How do I tell, prgrammatically, if a file is opened for read/write by some other process? In unix .. of course. My program needs to open files and work on it, and I want it to make...
6
by: Dildo Boy | last post by:
I am trying to write a program which asks the user to enter a number in the interval , the program then gives the natural logarithm of that number, using the series for log(x+1)... Here is what...
1
by: kang jia | last post by:
hi currently i am editing signup page, when user enter deupicated NRIC and click signup, they will go to do_signuppage and read the error message and then after 5 seconds, they will be redirected...
1
by: kang jia | last post by:
hi when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page...
3
lee123
by: lee123 | last post by:
I have a problem getting the correct to count +1 every time I get an answer right and the incorrect is the same. I have two lbl's named number1 and number2 which produces a Rnd# in each lbl. ...
10
by: onetruelove | last post by:
I want to creat a post like this blog: http://onlinetoefltest.blogspot.com/2007/08/level-c-lesson-1.html When you chose all the answers and click show answer a msg box will appear and tells how...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.