I am using Subsonic 2.1 and I need to do an innerjoin and use a where expression and I keep getting the error:
Must declare the scalar variable "@Partner"
Here is my code:
Dim ds As DataSet = UWP.Model.DB.Select("TOP 30 FirstName, LastName, EmailAddress, CustomerRowID, CompanyName")
.From("Customer").InnerJoin("Partner")
.Where("Partner.PartnerID").IsEqualTo("Customer.PartnerID")
.WhereExpression("FirstName").Like("%" & SearchTerm & "%")
.Or("LastName").Like("%" & SearchTerm & "%")
.Or("EmailAddress").Like("%" & SearchTerm & "%")
.CloseExpression()
.ExecuteDataSet()
I have tried re-arranging this thing about 10 different ways and just can't seem to get it right.