I have an SQL stored procedure to insert data in database that take two parameter where the first is an int and the second is an UniqueIdentifier.
I have consumed the SQL schemas in my BizTalk project.
I have a webservice that sends the data to BizTalk for inserting in database. The web-service also has to parameter a int and string that contains a GUID value.
I also have an BizTalk map that map from the web-service schema to SQL schema, but when running it I get this error:
Invalid cast from 'System.String' to 'System.Guid'
Why do I get this error and how do I fix it?
It's because you can't cast from String to Guid.
You have to use Guid.Parse() or .ParseExact() to convert the string representation of a Guid to a Guid Type.