TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ehssan Dannouf
NA
36
2.9k
Csharp method does not save or return any value eventhough
Feb 29 2020 3:28 PM
Hello! How are you doing dear all?
I am trying to do some training in Csharp, typing a small console program to calculate vaules from seperated classes and methods, I have typed like these lines so far:
using
System;
namespace
spacesqm
{
public
class
EnterData
{
public
int
length;
public
int
width;
public
int
height;
public
int
EnterNumbers ()
{
Console.WriteLine (
"Welcome, Can you press any Key to proceed!"
);
Console.ReadKey ();
//Type and record the 'length' Variable
Console.WriteLine (
"Type The Length in centimeter: "
);
length = Convert.ToInt32 (Console.ReadLine());
Console.WriteLine (
"Type The width in centimeter: "
);
width = Convert.ToInt32 (Console.ReadLine());
Console.WriteLine (
"Type The height in centimeter: "
);
height = Convert.ToInt32 (Console.ReadLine());
//Type Thank you and close the method
Console.WriteLine (
"Thank you a lot the information had been entered successfully!"
);
Console.WriteLine (
"Type any key to Calculate..."
);
Console.ReadKey ();
Console.Clear ();
return
(length, width, height) ;
}
}
}
The problem is that, when I call the values from another class, the value return 0 eventhough...
Do you have any solution pls?
Thank you & Regards,
Ehssan Dannouf,
Reply
Answers (
7
)
An unhandled exception of type System.Data.OleDb.OleDbExcep
swap arrays given by the user