I have a question regarding a query in LINQ:
DataClasses1DataContext db = new DataClasses1DataContext();
var shpnme = from p in db.Orders
where p.ShipCity == "A"
select p.ShipName;
Am I correct in believing that the database will use the Orders database, and where in “ShipCity” any entries = “A” it will return the Shipname of that ShipCity’s entry?
Also can you do a wildcard? e.g. A*
Yes you are correct, this will return all ShipNames where the ShipCity equals “A” . A sort-of wildcard search can be done using
.Contains(),.StartsWith()and.EndsWith()