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
Suma M
NA
162
50.2k
Creating many objects of same class...
May 8 2013 1:43 AM
Hi,
I have 2 overloaded methods given below
public DataSet LoadDataSet(string SPNAME,string FieldID)
{
sqlcommand cmd=new sqlcommand;
}
============================================
public DataSet LoadDataSet(string SPNAME,string FieldID,string FieldName)
{
sqlcommand cmd=new sqlcommand;
}
Now instead of creating 2 objects of the same class, can i declare a sqlcommand object and use it in any number of methods.. i want to put this sqlcommand object in a global class and use it.. Is this correct?
Reply
Answers (
3
)
C# using linq statement
Can i dynamically create a sql query statement in a method?