please take a look :
'this is linq to sql
Dim searchParam As String
Select Case Me.SearchToolStripComboBox.Text
Case "Name" : searchParam = "Teacher.Name"
Case "Address" : searchParam = "Teacher.Address"
Case "Phone" : searchParam = "Teacher.Phone"
Case "Handphone" : searchParam = "Teacher.Handphone"
Case "Email" : searchParam = "Teacher.Email"
Case "Website" : searchParam = "Teacher.Website"
Case "YM" : searchParam = "Teacher.YM"
Case "MSN" : searchParam = "Teacher.MSN"
End Select
Dim SetTeacher = From teacher In db.tbTeachers _
Where searchParam Like Me.SearchToolStripTextBox.Text & "*" _
Select teacher.Name, teacher.Address, teacher.Phone, teacher.Handphone, teacher.Website, teacher.Email, teacher.YM, teacher.MSN, teacher
i ran this, but i got no record, when i tried to msgbox setteacher.tostring, the problem was actually in where clause , it can't read my searchparam variable(though it contained string which i wanted, i've checked it ).
i have no problem in other part, since because if i executed it directly by replacing that searchparam to e.g : teacher.address, i got my correct result.
msgbox yield :
Where clause by using searchparam (which contains teacher.address) : where @p0 = 1
Where clause by using teacher.address : where [t0].[address] like @p0
what cause that ? how to retrieve the value ?
Thank You Very Much.