Try this:
Dim delimStr As String = "'""&"
Dim delimiter As Char() = delimStr.ToCharArray()
If TextBox1.Text.IndexOfAny(d
MessageBox.Show("Cannot contain Special Characters ', "", or & ", "Update Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
However, you might be better off to simply parse the string to insert escape characters that will not blow the update. Then, you just parse out the escape characters when you want to show the text again.
Let me know if you want some help parsing the Text to allow special characters.
Jake
Main Topics
Browse All Topics





by: TimCotteePosted on 2005-10-04 at 06:58:44ID: 15013914
Hi msyed1,
Specials) > 0 Then
For the first two situation, you should be able to double the ' and " characters and they will be inserted into the record and stored with a single ' or ".
Otherwise you can do this any number of ways, using regular expressions or something like this:
Dim Specials() As string = {"'","""","&"}
If MySourceString.IndexOfAny(
Msgbox "Ooops, entered a special character"
End If
Tim Cottee