Refactoring/Optimizing code

Status
Not open for further replies.

MB34

Member
Joined
Jul 7, 2008
Messages
10
Programming Experience
10+
Using FXCop to optimize and refactor application, how do I get
rid of the avoid unused private fields notification in the code
below? If I use one dummy field, I'll still get the notification.

VB.NET:
Dim sHGBvalue, sHGBdate As String
.
.
dreader = SQLCommand.ExecuteReader(CommandBehavior.SingleRow)
If dreader.Read() Then
    sHGBvalue = dreader(0)
    sHGBdate = dreader(1)
End If
dreader.Close()
Do I really need to assign the dreader(0) and dreader(1) to
anything at all? Can't I just use this:
VB.NET:
If dreader.Read() Then
End If
dreader.Close()
 
Status
Not open for further replies.
Back
Top