0

我有一些这样的代码:

Function GetTypeFromTableName(ByVal _TableName As String, ByVal _DataContext As DataContext)

    Dim Mytype As Type = (From t In _DataContext.Mapping.GetTables Where t.TableName = "dbo." + _TableName Select t.RowType.Type).SingleOrDefault
    Return Mytype

End Function

Dim DBA As New LINQDataContext
_TBLName="City"
TableType = GetTypeFromTableName(_TBLName, DBA)

Dim GridQuery = From T In DBA.GetTable(TableType) Select T

If Chk.Checked Then
    CallByName(obj, "CName", CallType.Set, Txt_Name.Text)
    GridQuery = From T In DBA.GetTable(TableType) Where T Like obj
End If

此搜索不起作用,我收到此错误:

{“方法 'System.Object LikeObject(System.Object, System.Object, Microsoft.VisualBasic.CompareMethod)' 没有支持的 SQL 转换。”} System.Exception

我应该为这个过滤器做什么?vb.net linq

4

1 回答 1

1

其中 T.Contains(obj)

于 2009-02-01T06:50:02.343 回答