This is so bizarre I hesitate to post it, but I need to get this working.
My code looks like this...
Private Const cmdTestResource sSel = "SELECT * FROM TResources" & _
" WHERE Scenario =
@Scenario"
Dim cmdstr as String
cmdstr = cmdTestResource sSel
If history Then
cmdstr.Replace( "TResources ", "TResourcesHist ory")
End If
Dim cmdS As SqlCommand = New SqlCommand(cmds tr, cnTest)
History is true. Coming out of the "if" statement, cmdstr is unchanged.
CommandText of the SQLCommand contains "TResources " not "TResourcesHist ory"
This same code template works in the same program in about a dozen other
places. No exceptions thrown. I can do the replace on cmdstr in the
command window while debugging the app and it works fine.
What's up with this???
Thanks for your help.
BBM
My code looks like this...
Private Const cmdTestResource sSel = "SELECT * FROM TResources" & _
" WHERE Scenario =
@Scenario"
Dim cmdstr as String
cmdstr = cmdTestResource sSel
If history Then
cmdstr.Replace( "TResources ", "TResourcesHist ory")
End If
Dim cmdS As SqlCommand = New SqlCommand(cmds tr, cnTest)
History is true. Coming out of the "if" statement, cmdstr is unchanged.
CommandText of the SQLCommand contains "TResources " not "TResourcesHist ory"
This same code template works in the same program in about a dozen other
places. No exceptions thrown. I can do the replace on cmdstr in the
command window while debugging the app and it works fine.
What's up with this???
Thanks for your help.
BBM
Comment