hi
i have a source code that check some email address and deactive emails that are invalid.
it's my update command
Dim com As New SqlCommand("Update Newsletter_Emails Set Active='False' Where (Email IN (" & Error_Email & "))", con)
also i have tested some option like ... Where (Email IN " & Error_Email & ")", con)
and ... Where Email IN '" & Error_Email & "'", con)
but any way it has some error :
Unclosed quotation mark after the character string ''))'.
Incorrect syntax near ''))'.
any suggestion?
thanks in advance
Loading
VulpesPosted Jun 3, 2012, 6:30 AM
However, it is still possible to do it in a composite way if Error_Email contains something like this:
Dim Error_EMail As String = "'[email protected]', '[email protected]', '[email protected]'"
The following UPDATE statement should then work:
Dim com As New SqlCommand("Update Newsletter_Emails Set Active='False' Where Email IN (" & Error_Email & ")", con)
Anil KumarPosted Jun 3, 2012, 5:43 AM
Bahar JalaliPosted Jun 3, 2012, 1:31 AM
tan hongyouPosted Jun 2, 2012, 8:01 PM
brunda kPosted Jun 2, 2012, 2:21 PM
In the above code Email IN '" & Error_Email & "'"
replace with
Email IN ('" & Error_Email & "')"
VulpesPosted Jun 2, 2012, 1:51 PM
Bahar JalaliPosted Jun 2, 2012, 12:01 PM
every my try don't work! why?
my last try is :
Dim mystr As String = "Update Newsletter_Emails Set Active='False' Where Email IN" & Error_Email
but don't work
error is :
Incorrect syntax near ''.
Unclosed quotation mark after the character string '''.
also i tried this one :
Dim mystr As String = "Update Newsletter_Emails Set Active='False' Where Email IN '" & Error_Email & "'"
and get this error :
VulpesPosted Jun 1, 2012, 4:38 AM
Unclosed quotation mark after the character string ''))'.
Although I'd have thought this would have been noticeable, I'd check it anyway.
tan hongyouPosted May 31, 2012, 8:02 PM
Dim com As New SqlCommand("Update Newsletter_Emails Set Active='False' Where Email IN (" & Error_Email & ")", con)