473,406 Members | 2,633 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,406 software developers and data experts.

Over Riding New?

Hi All,

I am (As you may have seen from my last two posts!) converting from VB
to C#

At the moment, I am stuck with over riding the New method of my class.

I am trying to have a new which allows the user to pass the context of
the current HTTPApp (This class will be used by a web app)

Heres what I have so far, this doesnt work...Visual studio underlines
the open bracket with message:
"Invalid token '(' in class, struct, member or interface declaration"

public new void(HttpApplication currentHTTPApp) {
_HttpApplication = currentHTTPApp;
}

Any help here will be appreciated!

Cheers!
Nov 21 '07 #1
2 1267
TisMe <si**********@googlemail.comwrote:
I am (As you may have seen from my last two posts!) converting from VB
to C#

At the moment, I am stuck with over riding the New method of my class.
There's no such method as "new" - there are constructors. You don't
override a constructor, you just provide constructors for your class.
For instance:

public class Test
{
// This is a constructor
public Test(string x)
{
}
}

There's more about constructors at
http://pobox.com/~skeet/csharp/constructors.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Nov 21 '07 #2
On Nov 21, 10:00 pm, Jon Skeet [C# MVP] <sk...@pobox.comwrote:
TisMe <simonmhar...@googlemail.comwrote:
I am (As you may have seen from my last two posts!) converting from VB
to C#
At the moment, I am stuck with over riding the New method of my class.

There's no such method as "new" - there are constructors. You don't
override a constructor, you just provide constructors for your class.
For instance:

public class Test
{
// This is a constructor
public Test(string x)
{
}

}

There's more about constructors athttp://pobox.com/~skeet/csharp/constructors.html

--
Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
World class .NET training in the UK:http://iterativetraining.co.uk
Jon, Thank you - I will have a read.

Simon.

Nov 22 '07 #3

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

Similar topics

7
by: rdh | last post by:
Hi all, I am in process of developing a Server in C++ supporting multiple protocols. The server will be exposing various functionalities, and the clients can communicate over any of the...
2
by: Matt | last post by:
here's some more code i inherited on a project: function set_background(pic){ if(pic==""){ if(ie4)over.backgroundImage="none"; if(ns6)over.style.backgroundImage="none"; }else{ if(ns4){...
5
by: Paul Reddin | last post by:
Hi, using ROWNUMBER() is affecting the plan of a view very badly... is there a way of writing the following view to ensure rownumber() is done as the last thing done? i.e after the calling...
56
by: Raphi | last post by:
Hi, I've been using an Access application I wrote for an office with the front-end stored on all computers and the back-end on one of them serving as an Access file server. Now we're moving...
6
by: news | last post by:
I need some concise, easy to grok examples of what .Net (preferably C#.Net) has over just using old ASP or PHP with JavaScript. See, I'm a PHP guy, and while I started server-side scripting with...
5
by: Nikolay Petrov | last post by:
I have a ListBox, which is binded to a DataTable. I would like to display a tooltip when the mouse cursor hovers over the items in the ListBox. I don't know how to find the index if ListBox item,...
74
by: ljh | last post by:
Why would you choose SQL Express (which requires an installed application to work) over the simplicity of an Access database which has no dependencies?
3
by: Sebastian | last post by:
Hello all I have a report where I have two nested groups. I know there are only three standard options for running sum: None, Over Group and Over All. I have a MyTextBox in detail section where...
3
by: Andrew 2006 | last post by:
Hi there, I'm trying to understand the differences between sending XML over TCP and XML over HTTP (SOAP). However I'm not having much luck finding good articles on the www. Can anyone...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.