Click here to Skip to main content
15,907,395 members
Home / Discussions / C#
   

C#

 
GeneralRe: Learning C# for a beginner Pin
Diego Carrion24-Aug-12 10:06
Diego Carrion24-Aug-12 10:06 
GeneralRe: Learning C# for a beginner Pin
wizardzz24-Aug-12 10:12
wizardzz24-Aug-12 10:12 
GeneralRe: Learning C# for a beginner Pin
Diego Carrion24-Aug-12 10:35
Diego Carrion24-Aug-12 10:35 
GeneralRe: Learning C# for a beginner Pin
wizardzz24-Aug-12 10:42
wizardzz24-Aug-12 10:42 
GeneralRe: Learning C# for a beginner Pin
Diego Carrion24-Aug-12 11:20
Diego Carrion24-Aug-12 11:20 
Questionpass paramters to C# 2008 app Pin
sc steinhayse24-Aug-12 5:51
sc steinhayse24-Aug-12 5:51 
AnswerRe: pass paramters to C# 2008 app Pin
Wes Aday24-Aug-12 6:02
professionalWes Aday24-Aug-12 6:02 
AnswerRe: pass paramters to C# 2008 app Pin
Richard MacCutchan24-Aug-12 7:29
mveRichard MacCutchan24-Aug-12 7:29 
AnswerRe: pass paramters to C# 2008 app Pin
wizardzz24-Aug-12 10:14
wizardzz24-Aug-12 10:14 
QuestionDealing with SQL Server Table Column Name with Special Character Pin
Ankitaaguggi24-Aug-12 5:37
Ankitaaguggi24-Aug-12 5:37 
AnswerRe: Dealing with SQL Server Table Column Name with Special Character Pin
Dave Kreskowiak24-Aug-12 6:18
mveDave Kreskowiak24-Aug-12 6:18 
AnswerRe: Dealing with SQL Server Table Column Name with Special Character Pin
jschell24-Aug-12 8:46
jschell24-Aug-12 8:46 
QuestionC# 2010 standard output Pin
sc steinhayse24-Aug-12 3:44
sc steinhayse24-Aug-12 3:44 
AnswerRe: C# 2010 standard output Pin
sjelen24-Aug-12 4:06
professionalsjelen24-Aug-12 4:06 
AnswerRe: C# 2010 standard output Pin
Dave Kreskowiak24-Aug-12 4:34
mveDave Kreskowiak24-Aug-12 4:34 
GeneralRe: C# 2010 standard output Pin
sc steinhayse24-Aug-12 6:01
sc steinhayse24-Aug-12 6:01 
GeneralRe: C# 2010 standard output Pin
Dave Kreskowiak24-Aug-12 6:15
mveDave Kreskowiak24-Aug-12 6:15 
QuestionSQL Connection problem in Windows Service asp.net c# Pin
Member 799263524-Aug-12 0:22
Member 799263524-Aug-12 0:22 
AnswerCross post Pin
Pete O'Hanlon24-Aug-12 0:35
mvePete O'Hanlon24-Aug-12 0:35 
AnswerRe: SQL Connection problem in Windows Service asp.net c# Pin
Vijay Selvaraj26-Aug-12 21:56
Vijay Selvaraj26-Aug-12 21:56 
QuestionC# 2010 parse a file Pin
classy_dog23-Aug-12 17:49
classy_dog23-Aug-12 17:49 
AnswerRe: C# 2010 parse a file Pin
pramod.hegde23-Aug-12 20:05
professionalpramod.hegde23-Aug-12 20:05 
AnswerRe: C# 2010 parse a file Pin
wizardzz24-Aug-12 9:54
wizardzz24-Aug-12 9:54 
Question[Problem Solved] how to access a class of a file A.cs from other file B.cs Pin
jamesfrj23-Aug-12 13:33
jamesfrj23-Aug-12 13:33 
Hello everyone! I am a new in C# and was trying to access a class from another.

I have created the file Cliente.cs below:

C#
class Cliente
{
	public string nome;
	public int codigo;
}

Afterwards I have created the file TestaCliente.cs with this code:

C#
class TestaCliente
{
	static void Main()
	{
		Cliente c1 = new Cliente();
		c1.nome = "Rafael Consentino";
		c1.codigo = 1;
		
		Cliente c2 = new Cliente();
		c2.nome = "Jonas Hirata";
		c2.codigo = 2;
		
		System.Console.WriteLine(c1.nome);
		System.Console.WriteLine(c1.codigo);
		
		System.Console.WriteLine(c2.nome);
		System.Console.WriteLine(c2.codigo);
	}

}

I have tried to compile the file TestaCliente.cs via command prompt with "csc TestaCliente.cs" and the following error message appears :

Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.

TestaCliente.cs(6,4): error CS0246: The type or namespace name 'Cliente' could
not be found (are you missing a using directive or an assembly
reference?)
TestaCliente.cs(6,21): error CS0246: The type or namespace name 'Cliente' could
not be found (are you missing a using directive or an assembly
reference?)
TestaCliente.cs(10,4): error CS0246: The type or namespace name 'Cliente' could
not be found (are you missing a using directive or an assembly
reference?)
TestaCliente.cs(10,21): error CS0246: The type or namespace name 'Cliente' could
not be found (are you missing a using directive or an assembly
reference?)

Obs.:The files are in the same folder.

What am I doing wrong?

Thank you

modified 30-Aug-12 6:32am.

AnswerRe: how to access a class of a file A.cs from other file B.cs Pin
harold aptroot23-Aug-12 14:42
harold aptroot23-Aug-12 14:42 

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.