Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need to convert this SQL Query to LINQ Pin
murali_utr4-Mar-12 6:39
murali_utr4-Mar-12 6:39 
AnswerRe: Need to convert this SQL Query to LINQ Pin
thatraja4-Mar-12 6:56
professionalthatraja4-Mar-12 6:56 
QuestionCalling Base Class Constructor - base() Pin
AmbiguousName3-Mar-12 19:39
AmbiguousName3-Mar-12 19:39 
AnswerRe: Calling Base Class Constructor - base() PinPopular
Abhinav S3-Mar-12 21:22
Abhinav S3-Mar-12 21:22 
GeneralRe: Calling Base Class Constructor - base() Pin
BillWoodruff3-Mar-12 23:14
professionalBillWoodruff3-Mar-12 23:14 
GeneralRe: Calling Base Class Constructor - base() Pin
Abhinav S5-Mar-12 1:00
Abhinav S5-Mar-12 1:00 
GeneralRe: Calling Base Class Constructor - base() Pin
ProEnggSoft5-Mar-12 22:21
ProEnggSoft5-Mar-12 22:21 
AnswerRe: Calling Base Class Constructor - base() Pin
DaveyM694-Mar-12 0:35
professionalDaveyM694-Mar-12 0:35 
Abhinav's answer is good. Just to expand a little...

The base class's parameterless constructor, if it has one, will automatically be called if you don't specify a different base constructor, i.e. one that has parameters, explicitly.

If the base class doesn't have a parameterless constructor then you must specify which base constructor you want to call, even if there is only one.

C#
public class Base
{
    protected int id;

    public Base(int id)
    {
        this.id = id;
    }

    public int ID
    {
        get { return id; }
    }
}

public class Derived : Base
{
    private string text;

    public Derived(string text)
        : base(1)
    {
        this.text = text;
    }

    public string Text
    {
        get { return text; }
        set
        {
            // ToDo: Validate value
            text = value;
        }
    }
}

Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)



QuestionCrystal report problem in C# application Pin
Shuaib wasif khan3-Mar-12 4:37
Shuaib wasif khan3-Mar-12 4:37 
GeneralRe: Crystal report problem in C# application Pin
Shameel3-Mar-12 5:08
professionalShameel3-Mar-12 5:08 
GeneralRe: Crystal report problem in C# application Pin
Shuaib wasif khan3-Mar-12 20:34
Shuaib wasif khan3-Mar-12 20:34 
GeneralRe: Crystal report problem in C# application Pin
Shameel3-Mar-12 20:44
professionalShameel3-Mar-12 20:44 
GeneralRe: Crystal report problem in C# application Pin
Shuaib wasif khan3-Mar-12 21:27
Shuaib wasif khan3-Mar-12 21:27 
GeneralRe: Crystal report problem in C# application Pin
Shameel3-Mar-12 21:49
professionalShameel3-Mar-12 21:49 
AnswerRe: Crystal report problem in C# application Pin
jschell5-Mar-12 8:38
jschell5-Mar-12 8:38 
QuestionC# Favorites Pin
MAW302-Mar-12 18:30
MAW302-Mar-12 18:30 
AnswerRe: C# Favorites Pin
thatraja2-Mar-12 19:26
professionalthatraja2-Mar-12 19:26 
AnswerRe: C# Favorites Pin
Shameel2-Mar-12 19:28
professionalShameel2-Mar-12 19:28 
Questionto send mass emails Pin
MemberDotNetting2-Mar-12 13:00
MemberDotNetting2-Mar-12 13:00 
AnswerRe: to send mass emails Pin
SilimSayo2-Mar-12 13:16
SilimSayo2-Mar-12 13:16 
AnswerRe: to send mass emails Pin
Dave Kreskowiak2-Mar-12 13:44
mveDave Kreskowiak2-Mar-12 13:44 
AnswerRe: to send mass emails Pin
Richard MacCutchan2-Mar-12 23:10
mveRichard MacCutchan2-Mar-12 23:10 
AnswerRe: to send mass emails Pin
Abhinav S2-Mar-12 23:49
Abhinav S2-Mar-12 23:49 
AnswerRe: to send mass emails Pin
jschell5-Mar-12 8:40
jschell5-Mar-12 8:40 
QuestionCorrection to last message Pin
tombailey2-Mar-12 6:48
tombailey2-Mar-12 6:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.