1. Tokia užklausa reikalinga vykdant paiešką:
Dim oCources = From c In oDB.TrainingCourses
Join td In oDB.TrainingDescs On c.CourseID Equals td.TrDCourseID
Where c.CourseActive = "Y"
And (Data.Linq.SqlClient.SqlMethods.Like(c.CourseTitle, "%" & tbSearch.Text & "%") Or Data.Linq.SqlClient.SqlMethods.Like(td.TrDTitle, "%" & tbSearch.Text & "%"))
Select c.CourseTitle, td.TrDTitle, td.TrDID
2. Užklausa su LIKE, ignoruojanti didžiąsias ir mažąsias raides
Dim objF = (From ed In odb.EducationInstitutions
Where Data.Linq.SqlClient.SqlMethods.Like(ed.Name, "" & Name.Trim & "", StringComparison.CurrentCultureIgnoreCase.ToString) And ed.Status = "OK").FirstOrDefault
Komentarų nėra:
Rašyti komentarą