B
Balaji Kannan
Hi,
In dot net during component development i have used some
member variables in the class file. Inside the class i
have used the member declaration and the instant handling
in the following way.
In the constructor i have created the connection instant
in the following way
public Global(string connString)
{
//member variable
private Sqlconnection m_connDB;
.......
.......
m_connDB = new SqlConnection(connString);
.....
.....
}
In otherway we can do the member declaration and the
object creation in the same place. That is
public Global(string connString)
{
//member variable
private Sqlconnection m_connDB = new SqlConnection
(connString);
.......
......
.....
.....
}
Among the above which one is best as for the performance
is concerned. Which one is more advisable? Can anyone
guide me..
Advance thanks and regards
In dot net during component development i have used some
member variables in the class file. Inside the class i
have used the member declaration and the instant handling
in the following way.
In the constructor i have created the connection instant
in the following way
public Global(string connString)
{
//member variable
private Sqlconnection m_connDB;
.......
.......
m_connDB = new SqlConnection(connString);
.....
.....
}
In otherway we can do the member declaration and the
object creation in the same place. That is
public Global(string connString)
{
//member variable
private Sqlconnection m_connDB = new SqlConnection
(connString);
.......
......
.....
.....
}
Among the above which one is best as for the performance
is concerned. Which one is more advisable? Can anyone
guide me..
Advance thanks and regards