I have a form with a phone# field that populates the @Phone param of an .NET SQLCommand object used to do an Insert into a table. The DB field is char(12), as is the param. The field is not required. I populate the param with:
SqlCommandINSERT.Parameters("@Phone".Value = trim(Phone.Text)
After this statement executes, I confirm that the param value is "", not " ". However, when I look in the DB, the phone field appears to have 12 blank spaces, but why? It should be an empty string.
This DB field allows nulls, though I always enter a string, even a blank, and probably should change it to not allow nulls.
SqlCommandINSERT.Parameters("@Phone".Value = trim(Phone.Text)
After this statement executes, I confirm that the param value is "", not " ". However, when I look in the DB, the phone field appears to have 12 blank spaces, but why? It should be an empty string.
This DB field allows nulls, though I always enter a string, even a blank, and probably should change it to not allow nulls.