© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
3 replies
CoreVisional

✅ Cannot convert from string[] to 'char' [SOLVED]

Hi, I'm getting this error that I am converting from string[] to char. The data type for the field I am trying to retrieve isn't char but string. Somehow, I receive this error message.
var allLocations = new[] { "PlaceOne", "PlaceTwo" };

var locations = _context.CityLocations.Where(x => x.Location.Contains(allLocations)).ToList(); //Cannot convert from string[] to 'char'
var allLocations = new[] { "PlaceOne", "PlaceTwo" };

var locations = _context.CityLocations.Where(x => x.Location.Contains(allLocations)).ToList(); //Cannot convert from string[] to 'char'
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Cannot implicitly convert int to string
C#CC# / help
13mo ago