Click here to Skip to main content
16,008,175 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dictionary Problem Pin
freakyit11-Oct-09 22:29
freakyit11-Oct-09 22:29 
Questionregarding auto generated mail in window application Pin
NarendraSinghJTV11-Oct-09 21:43
NarendraSinghJTV11-Oct-09 21:43 
AnswerRe: regarding auto generated mail in window application Pin
SeMartens11-Oct-09 21:49
SeMartens11-Oct-09 21:49 
GeneralRe: regarding auto generated mail in window application Pin
NarendraSinghJTV11-Oct-09 22:55
NarendraSinghJTV11-Oct-09 22:55 
QuestionProblem with RichText Box(Right Click Cut/Copy/Paste/SelectAll)... Pin
spalanivel11-Oct-09 21:41
spalanivel11-Oct-09 21:41 
AnswerRe: Problem with RichText Box(Right Click Cut/Copy/Paste/SelectAll)... Pin
Lyon Sun11-Oct-09 22:01
Lyon Sun11-Oct-09 22:01 
GeneralRe: Problem with RichText Box(Right Click Cut/Copy/Paste/SelectAll)... Pin
spalanivel11-Oct-09 22:06
spalanivel11-Oct-09 22:06 
GeneralRe: Problem with RichText Box(Right Click Cut/Copy/Paste/SelectAll)... Pin
Lyon Sun11-Oct-09 22:26
Lyon Sun11-Oct-09 22:26 
AnswerRe: Problem with RichText Box(Right Click Cut/Copy/Paste/SelectAll)... Pin
dan!sh 11-Oct-09 22:07
professional dan!sh 11-Oct-09 22:07 
QuestionTo modify table column. Pin
kmb8911-Oct-09 19:54
kmb8911-Oct-09 19:54 
AnswerRe: To modify table column. Pin
SeMartens11-Oct-09 21:51
SeMartens11-Oct-09 21:51 
GeneralRe: To modify table column. Pin
kmb8911-Oct-09 22:14
kmb8911-Oct-09 22:14 
GeneralRe: To modify table column. Pin
SeMartens11-Oct-09 22:21
SeMartens11-Oct-09 22:21 
GeneralRe: To modify table column. Pin
kmb8911-Oct-09 22:51
kmb8911-Oct-09 22:51 
AnswerRe: To modify table column. Pin
Md. Marufuzzaman11-Oct-09 23:37
professionalMd. Marufuzzaman11-Oct-09 23:37 
GeneralRe: To modify table column. Pin
Md. Marufuzzaman11-Oct-09 23:41
professionalMd. Marufuzzaman11-Oct-09 23:41 
QuestionTimeout expired Pin
MozhdehQeraati11-Oct-09 19:12
MozhdehQeraati11-Oct-09 19:12 
AnswerRe: Timeout expired Pin
Saksida Bojan11-Oct-09 23:03
Saksida Bojan11-Oct-09 23:03 
AnswerRe: Timeout expired Pin
Md. Marufuzzaman11-Oct-09 23:48
professionalMd. Marufuzzaman11-Oct-09 23:48 
AnswerRe: Timeout expired Pin
Luc Pattyn12-Oct-09 0:15
sitebuilderLuc Pattyn12-Oct-09 0:15 
AnswerRe: Timeout expired Pin
Dave Kreskowiak12-Oct-09 8:25
mveDave Kreskowiak12-Oct-09 8:25 
QuestionChanging Folder Permission using C# Pin
MikeSharp11-Oct-09 18:21
MikeSharp11-Oct-09 18:21 
QuestionList of classes as a property of a class Pin
Protus11-Oct-09 16:06
Protus11-Oct-09 16:06 
I want to have a class name Faculty with some memeber properties. One of the property is a (list of student classes) List<myStudent>. I have a student class (as given below).

When I compile I get the following error:

"Inconsistent accessibility: parameter type 'NestedClass.myStudent' is less accessible than method 'NestedClass.myFacultyMember.AddMyNewItem"

What am I doing wrong?
Cannot we access user defined data types (in this case a class object) within a class from outside?

Thank you in advance!

------------student class-----------------------
<using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NestedClass
{
class myStudent
{
private int studentID;
private string firstName;
private string lastName;
private int age;

public myStudent()
{
}
~myStudent()
{
}

public int StudentID
{
get
{
return studentID;
}
set
{
studentID = value;
}
}
public string FirstName
{
get
{
return firstName;
}
set
{
firstName = value;
}
}
public string LastName
{
get
{
return lastname;
}
set
{
lastname = value;
}
}
public int Age
{
get
{
return age;
}
set
{
age = value;
}
}
}
}

----------- Faculty Class ---------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NestedClass
{
public class myFacultyMember
{
private int facultyID;
private string firstName;
private string lastName;
private int age;

private List<myStudent> lst_Students = new List<myStudent>();

public myFacultyMember()
{
}
~myFacultyMember()
{
}

public int FacultyID
{
get
{
return facultyID;
}
set
{
facultyID = value;
}
}
public string FirstName
{
get
{
return firstName;
}
set
{
firstName = value;
}
}
public string LastName
{
get
{
return lastName;
}
set
{
lastName = value;
}
}
public int Age
{
get
{
return age;
}
set
{
age = value;
}
}

public void AddMyNewItem(myStudent newItem)
{
lst_Students.Add(newItem);
}
}
}>
AnswerRe: List of classes as a property of a class Pin
N a v a n e e t h11-Oct-09 17:00
N a v a n e e t h11-Oct-09 17:00 
QuestionStreamReader -&gt; StreamWriter... file comes out much bigger !! Pin
je198011-Oct-09 8:56
je198011-Oct-09 8:56 

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.