Reputation: 151
I want to get selection made in a dropdown and store it.
How can I fix this error for when setting value from dropdown dropmarket
?
Cannot implicitly convert type 'string' to 'System.Guid'
cellsite.Market.MarketID = dropmarket.SelectedValue;
Upvotes: 0
Views: 4216
Reputation: 47038
Change to
cellsite.Market.MarketID = Guid.Parse(dropmarket.SelectedValue);
A string
is not implicitly convertible to a Guid
. You use the Guid.Parse
method to convert a string to a Guid
.
Upvotes: 1