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
Bineesh Viswanath
NA
1k
780.4k
Difference on calling class within a function and Public
Oct 21 2013 1:49 AM
Sir, I need your help in the following topic:-
I here writing two methods of calling a class. Please give a explanation that which is better ,faster performable and more standard
Also tell me which method reduce size of the program?
1.Method 1:
namespace Employer
{
public partial class
frmRejectionIn : Form
{
public frmRejectionIn()
{
InitializeComponent();
}
EmployeeSP SPEmployee=new EmployeeSP();
// call class for entire form
}
2. Method 2:
private void
btnSave_Click(object sender, EventArgs e)
{
EmployeeSP SPEmployee=new EmployeeSP();
// call class within the function
}
private void
btnDelete_Click(object sender, EventArgs e)
{
EmployeeSP SPEmployee=new EmployeeSP();
// again called the class within the function
}
Reply
Answers (
3
)
Recfatoring Switch with Ploymorphism
Integration of gmail mails into asp.net using IMAP protocol