T
tshad
I am trying to update field and if nothing is in the .text field, I get an
error.
For example, if I have the following string:
Dim CommandText as String = "Update ftsolutions.dbo.Applicant set
salaryCurrent = @SalaryCurrent where applicantID = @applicantID"
with the following parameter:
.Add("@salaryCurrent",SqlDbType.Money).value = salaryCurrent.text
I will get an error if salaryCurrent.text has nothing in it.
I want to make the field null, if nothing is entered. Something like:
if salaryCurrent.text = ""
.Add("@salaryCurrent",SqlDbType.Money).value = Nthing
else
.Add("@salaryCurrent",SqlDbType.Money).value = salaryCurrent.text
end if
This doesn't work, but how would I make it work?
Thanks,
Tom.
error.
For example, if I have the following string:
Dim CommandText as String = "Update ftsolutions.dbo.Applicant set
salaryCurrent = @SalaryCurrent where applicantID = @applicantID"
with the following parameter:
.Add("@salaryCurrent",SqlDbType.Money).value = salaryCurrent.text
I will get an error if salaryCurrent.text has nothing in it.
I want to make the field null, if nothing is entered. Something like:
if salaryCurrent.text = ""
.Add("@salaryCurrent",SqlDbType.Money).value = Nthing
else
.Add("@salaryCurrent",SqlDbType.Money).value = salaryCurrent.text
end if
This doesn't work, but how would I make it work?
Thanks,
Tom.