Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 08, 2010 11:37 AM by parthasbhadra
Oct 08, 2010 11:09 AM|LINK
can anyone tell me if there is a performance diference between these two ways of calling an instance method?
DataAccess da = new DataAccess();
DataTable dt = da.GetDataTable(ConnString, CommandType.Text);
DataTable dt = new DataAccess().GetDataTable(ConnString, CommandType.Text);
Is one preferable over the other?
Thanks in advance.
Oct 08, 2010 11:30 AM|LINK
it's just a shortcut to
incase if you dont want to use the object created by the below statement in the subsequent statments then you can do like below else you can follow the above one.
Oct 08, 2010 11:37 AM|LINK
It only reduces LOC
if you dont want to use the object more than one within a scope then you can use