Hi,
I am recently using Fxcop , and in my application i used out parameter in a situation as described below. but Fxcop shows the message as
"Using out parameters might indicate a design flaw."
I have a method which returns the result set of database query as dictionary. I need to display the headings / [ the field selections used in the query for display purpose from the front end. so i used out put paramter to display the headings/selected fields of the query and dictionary to hold the records from database.
Let me know what is the other way to return the headings of the query as well the resultant records .
I am recently using Fxcop , and in my application i used out parameter in a situation as described below. but Fxcop shows the message as
"Using out parameters might indicate a design flaw."
I have a method which returns the result set of database query as dictionary. I need to display the headings / [ the field selections used in the query for display purpose from the front end. so i used out put paramter to display the headings/selected fields of the query and dictionary to hold the records from database.
Code:
public Dictionary<int, LogHeader> FetchErrorLog(out ReadOnlyCollection<string> readOnlyColNames) { Dictionary<int, LogHeader> dicHeader = new Dictionary<int, LogHeader>(); .................. List<string> colNames = new List<string>(); colNames = new List<string>(); colNames.Add("ErrorType"); colNames.Add("Description"); colNames.Add("Computer"); colNames.Add("Created"); readOnlyColNames = new ReadOnlyCollection<string>(colNames); }
Comment