I built a simple Data Access Layer with the Visual Studio 2005 DataSet
Designer using the wizard. All who I have talked to who use it,
articles I haver read by those who use it speak very highly about the
quality of code that vs2005 creates.
before adding any code of my own I ran "Code Analysis" (from debug
menu) against the code and got (no errors but) 90 warnings!
I know nothing about the "Code Analysis" and can find nothing in the
help. Some of the warnings are just good suggestions that the user
should consider based on best coding practice and the users intension
for the code such as;
Warning 4 CA2210 : Microsoft.Desig n : Sign 'NorthwindDataA ccess' with a
strong name key. 1
Other warnings point out things I think the Wizard should have handled;
Warning 42 CA1804 : Microsoft.Perfo rmance :
EmployeesTableA dapter.GetData( Nullable`1<Syst em.Int32>):Empl oyeesDataTable
declares a local, 'GetData', of type
NorthwindDataAc cess.EmployeeDa taSet+Employees DataTable, which is never
used or is only assigned to. Use this local or remove it. C:\Documents
and Settings\Admini strator\My Documents\Visua l Studio
2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1229 NorthwindDataAc cess
More Examples:
Warning 10 CA1801 : Microsoft.Perfo rmance : The 'this' parameter (or
'Me' in VB) of EmployeeDataSet .ShouldSerializ eEmployees():Bo olean is
never used. Mark the method as static (or Shared in VB) or use
'this'/Me in the method body. C:\Documents and
Settings\Admini strator\My Documents\Visua l Studio
2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 188 NorthwindDataAc cess
Warning 48 CA1709 : Microsoft.Namin g : Correct the casing of parameter
name 'LastName'. C:\Documents and Settings\Admini strator\My
Documents\Visua l Studio
2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1333 NorthwindDataAc cess
Warning 89 CA1706 : Microsoft.Namin g : 'Id' is an abbreviation and
therefore is not subject to acronym casing guidelines. Correct the
capitalization of 'ID' in parameter name 'EmployeeID' by changing it to
'Id'. C:\Documents and Settings\Admini strator\My Documents\Visua l
Studio
2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1460 NorthwindDataAc cess
Can anyone who knows more about this comment on this feature and the
results I am getting.
Thank you,
dbuchabab
Designer using the wizard. All who I have talked to who use it,
articles I haver read by those who use it speak very highly about the
quality of code that vs2005 creates.
before adding any code of my own I ran "Code Analysis" (from debug
menu) against the code and got (no errors but) 90 warnings!
I know nothing about the "Code Analysis" and can find nothing in the
help. Some of the warnings are just good suggestions that the user
should consider based on best coding practice and the users intension
for the code such as;
Warning 4 CA2210 : Microsoft.Desig n : Sign 'NorthwindDataA ccess' with a
strong name key. 1
Other warnings point out things I think the Wizard should have handled;
Warning 42 CA1804 : Microsoft.Perfo rmance :
EmployeesTableA dapter.GetData( Nullable`1<Syst em.Int32>):Empl oyeesDataTable
declares a local, 'GetData', of type
NorthwindDataAc cess.EmployeeDa taSet+Employees DataTable, which is never
used or is only assigned to. Use this local or remove it. C:\Documents
and Settings\Admini strator\My Documents\Visua l Studio
2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1229 NorthwindDataAc cess
More Examples:
Warning 10 CA1801 : Microsoft.Perfo rmance : The 'this' parameter (or
'Me' in VB) of EmployeeDataSet .ShouldSerializ eEmployees():Bo olean is
never used. Mark the method as static (or Shared in VB) or use
'this'/Me in the method body. C:\Documents and
Settings\Admini strator\My Documents\Visua l Studio
2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 188 NorthwindDataAc cess
Warning 48 CA1709 : Microsoft.Namin g : Correct the casing of parameter
name 'LastName'. C:\Documents and Settings\Admini strator\My
Documents\Visua l Studio
2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1333 NorthwindDataAc cess
Warning 89 CA1706 : Microsoft.Namin g : 'Id' is an abbreviation and
therefore is not subject to acronym casing guidelines. Correct the
capitalization of 'ID' in parameter name 'EmployeeID' by changing it to
'Id'. C:\Documents and Settings\Admini strator\My Documents\Visua l
Studio
2005\Projects\N orthwindDataAcc ess\NorthwindDa taAccess\Employ eeDataSet.Desig ner.vb 1460 NorthwindDataAc cess
Can anyone who knows more about this comment on this feature and the
results I am getting.
Thank you,
dbuchabab
Comment