Hi,
I'm trying to do an update with a Case Statement to a SQL DB, but I want to do it from my .NET Windows App
I have this, doesn't work...
it just doesn't do anything, obviously something is off- any ideas?
Thanks
I'm trying to do an update with a Case Statement to a SQL DB, but I want to do it from my .NET Windows App
I have this, doesn't work...
Code:
Sub FindReplace()
Dim cn As New SqlClient.SqlConnection
Dim cmd As New SqlClient.SqlCommand
Dim ISAID As String
Select Case ISAID
Case 8473819430
ISAID = 2016511600
Case 135926871
ISAID = "WEYERHAEUSER"
Case 6015823680
ISAID = 9784399625
cn.ConnectionString = strDbConn
cn.Open()
cmd.Connection = cn
Dim MySQL As String = "UPDATE InovisInt_Lisa " & _
"SET ISAID=@ISAID, " & _
"WHERE ISAID = @ISAID "
cmd.Parameters.Add(New SqlParameter("@ISAID", ISAID))
Dim myCommand As New SqlCommand(MySQL, cn)
myCommand.ExecuteNonQuery()
cn.Close()
End Select
End Sub
it just doesn't do anything, obviously something is off- any ideas?
Thanks