kwh3856
asked on
Cannot implicitly convert type 'string' to 'char?
I know this is simple for most of you out there but I do not know the coversion syntax it needs. Can someone post up the syntax for this conversion.
myCRpatient.SEX = patient.u.sex;------Squiggly line under patient.u.sex
ASKER
myCRpatient.Sex is a VARCHAR(1) in the database
patient.u.sex is a nvarchar
patient.u.sex is a nvarchar
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You should do one of the following
Change the type of patient.u.sex to a string
or you might be able to use
patient.u.sex.tostring
to convert the char to a string
Change the type of patient.u.sex to a string
or you might be able to use
patient.u.sex.tostring
to convert the char to a string
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cholor's Dad,
I tried that and it did not work. I tried tiggerito and it worked the first time.
DropZone,
Thank you. I am now using your logic in many different places in my code. Thank you for turning on the lights and bringing clairity to my understanding of conversions.
I tried that and it did not work. I tried tiggerito and it worked the first time.
DropZone,
Thank you. I am now using your logic in many different places in my code. Thank you for turning on the lights and bringing clairity to my understanding of conversions.
No worries. I always think it is better to explain the root cause of a problem and showing how to avoid it than to just give a code solution. "Give a man a fish...", and all that.
Cheers!
-dZ.
Cheers!
-dZ.
Is myCRpatuient.SEX a string? a Boolean? a number? what is it?
And then what type is patient.u.sex ?
To set them you have to know what each one is, if you mouse over them the IDE will let you know what they are.
-Rowan